Repository navigation
Isolate concurrent schema resolution state - #371
Open
RKS (rksharma-owg) wants to merge 1 commit into
Open
RKS (rksharma-owg) wants to merge 1 commit into
RKS (rksharma-owg) wants to merge 1 commit into
Conversation
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.
When two roots resolve the same external schema concurrently, the second can finish while a nested request is still pending. Its returned schema then changes after resolution; failed nested requests can also be missing from its diagnostics.
Reference merging currently shares nested objects from cached unresolved schemas. Deleting a
$refin one resolution therefore makes another resolution treat the same node as complete.This change gives each resolution its own mutable schema graph while retaining the shared download cache and existing merge behavior. Anchor lookup belongs to that graph, and embedded resources keep local aliases without exposing those nodes through globally cached handles. The copies preserve shared nodes and cycles within each copied document.
Validation on Node 22.23.1, macOS arm64:
75a46d7dbecause the second result resolves early, and pass with this patch.npm test: compilation, 5,355 tests, and 9 lint checks passed. The unchanged baseline passed 5,346 tests and 9 lint checks.The isolation adds in-memory copying per resolution; no performance improvement is claimed. Download reuse is asserted in the regressions. Public API signatures and reference merge rules are unchanged.
Fixes #350.
AI assistance: implemented and validated with OpenAI Codex.