Skip to content

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
mainfrom
issues#2840
Open

snyaggarwal wants to merge 1 commit into
mainfrom
issues#2840

Conversation

@snyaggarwal

Copy link
Copy Markdown
Contributor

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

  • 404s cached for the session (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.
  • Missing bridge targets dropped: once a code is known missing, its bridge_child candidates 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.
  • Both caches reset when the target version or lookup URL changes, since a code missing from one version may exist in another.

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 for dropMissingBridgeTargets)
  • eslint clean
  • Not exercised against a live bridge run

🤖 Generated with Claude Code

…ssion and drops bridge targets missing from the target version
@snyaggarwal
snyaggarwal requested a review from paynejd October 23, 2026 08:21
@snyaggarwal snyaggarwal self-assigned this Oct 23, 2026

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.

Mapper: the CIEL bridge proposes codes missing from the target version, and 404s aren't cached

1 participant