fix(transaction): resolve conditional references before execution - #467
Open
angela-helios wants to merge 2 commits into
Open
fix(transaction): resolve conditional references before execution#467angela-helios wants to merge 2 commits into
angela-helios wants to merge 2 commits into
Conversation
Conditional references (Type?query) passed through into storage verbatim, where nothing can search or resolve them — Synthea bundles name practitioners, organizations, and locations this way on every entry. Per the transaction processing rules they now resolve against the server's content before anything executes: exactly one match rewrites the reference to Type/id, zero or several reject the bundle. Distinct references resolve once (bundles repeat the same location heavily), and the search runs with count=2 — enough to prove non-uniqueness. Investigating the issue's other half showed urn:uuid fullUrl rewriting already works: the report's dangling urns came from NDJSON test data that had extracted raw bundle-entry resources, not from the transaction path. Closes #459
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #459
Conditional references (
Type?query) passed through into storage verbatim, where nothing can search or resolve them — Synthea bundles name practitioners, organizations, and locations this way on every entry, so the #448 dataset ingested with hundreds of unresolvable references.Per the transaction processing rules they now resolve against the server's content in a pre-pass before anything executes:
Type/id;Distinct references resolve once (bundles repeat the same location heavily) and each lookup searches with
count=2— enough to prove non-uniqueness. The pre-pass runs before write validation so validation sees the rewritten content.batch_handler/process_transactiongain aSearchProviderbound, which every backend and the route-level bound already satisfy.Scope correction on the issue
The issue's other half — urn:uuid fullUrl rewriting — turned out to be a false alarm: replaying both a minimal transaction and a real Synthea bundle against a clean server shows references correctly rewritten. The dangling urns in the original report came from my #448 $bulk-submit NDJSON (raw bundle-entry resources extracted verbatim), not from the transaction path. Noted on #459.
Tests
Three new integration tests in
batch_conformance(unique match rewritten into storage; zero matches reject; ambiguous match rejects); fullhelios-restsuite green (batch_conformance 42, search_integration 101, and the rest).