Skip to content

fix(ui): look up at most 64 SQL Library dependencies per render - #2953

Open
angela-helios wants to merge 1 commit into
mainfrom
fix/ui-sql-library-dependency-cap
Open

angela-helios wants to merge 1 commit into
mainfrom
fix/ui-sql-library-dependency-cap

Conversation

@angela-helios

Copy link
Copy Markdown
Contributor

Stacked on #2901. This branch starts from #2901's branch so that Test FHIRPath passes against the current fhir-test-cases master; its commit leaves this diff once #2901 merges.

Closes #2952

Summary

The SQL Query / SQL View page resolved every distinct depends-on reference on each render. Each one cost a FHIR read or a ViewDefinition search, and possibly a call to the terminology server, with no cap. A Library declaring thousands of dependencies therefore cost thousands of sequential calls whenever its page or Tables card rendered.

resolve_table_rows now looks up at most MAX_RESOLVED_DEPENDENCIES (64) distinct references per render. That is the number $sql-run accepts per Library by default (4 × HFS_SOF_SQLQUERY_MAX_VDS of 16).

The references past the cap get the new TableTarget::Unresolved row. It shows "Not looked up", with the detail "Only the first 64 distinct dependencies are looked up.", in en, es and de. It does not claim Not found for something that was never checked. A reference repeated under several labels still counts once.

Tests

router_http::a_library_with_too_many_dependencies_looks_up_only_the_first_64: a sql-view Library with 70 distinct dependencies renders 64 Not found rows (nothing stores them) and 6 Not looked up rows, plus the detail text.

With the cap lifted, every dependency is looked up and the test fails: left: 0, right: 6.

cargo test -p helios-ui: 1002 passed, the catalog tests for every locale included. Clippy on helios-ui --all-targets is clean.

The SQL Query / SQL View page resolved every distinct depends-on reference
on each render, one FHIR read or search (and possibly a terminology call)
each, with no cap. It now looks up the first 64, the number $sql-run
accepts per Library by default, and lists the rest as not looked up.

Closes #2952

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI resolves every SQL Library dependency on each render, with no cap

1 participant