Repository navigation
OpenConceptLab/ocl_issues#2840 | Mapper caches lookup 404s and drops bridge targets missing from the target version - #113
Open
snyaggarwal wants to merge 1 commit into
Open
snyaggarwal wants to merge 1 commit into
snyaggarwal wants to merge 1 commit into
Conversation
…ssion and drops bridge targets missing from the target version
This branch has not been deployed
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.
Fixes OpenConceptLab/ocl_issues#2840
Problem
The CIEL bridge filters cascade targets by the target repo URL, not its pinned version, so it can propose codes the version doesn't have (e.g. LOINC codes a newer CIEL maps to but LOINC 2.81 lacks). Each of those 404s, and since failed lookups were evicted from the URL cache, every row proposing the same code fetched it again.
Changes
fetchConceptByOclUrl): a lookup that is still 404 after its retries stays in the URL cache, so other rows reuse the result instead of fetching again. Other errors stay retryable.bridge_childcandidates are removed from every row, and later rows drop them on merge (no lookup triggered). A concept another algorithm also proposed keeps its row. Logic lives in a new pure helper,dropMissingBridgeTargets(normalizers.js), with unit tests.Caveat: retry on 404
The first row that proposes a missing code still makes 3 attempts (0s → 3s → 7s). That 404 retry comes from OpenConceptLab/ocl_issues#2537 and is intentional: a lookup repo may build a concept lazily, so its first 404 can turn into a hit a few seconds later. This PR keeps that behaviour unchanged, so a missing code costs 3 requests once per session rather than 3 per row.
Filtering missing codes before any fetch would need the bridge request (server or bridge component) to filter cascade targets by the target version — out of scope here.
Testing
npm test: 572 pass (3 new fordropMissingBridgeTargets)🤖 Generated with Claude Code