fix(core/xref): revert getUnversionedFallbacks, fix dedupeSpecContext empty-level bug - #5433
Draft
marcoscaceres with Copilot wants to merge 2 commits into
Draft
fix(core/xref): revert getUnversionedFallbacks, fix dedupeSpecContext empty-level bug#5433marcoscaceres with Copilot wants to merge 2 commits into
marcoscaceres with Copilot wants to merge 2 commits into
Conversation
… empty-level bug Co-authored-by: marcoscaceres <870154+marcoscaceres@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job for Karma Unit Tests
fix(core/xref): revert getUnversionedFallbacks, fix dedupeSpecContext empty-level bug
Aug 25, 2026
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.
getUnversionedFallbacks(introduced in #5226) was causing 12 CI karma test failures by injecting both versioned and unversioned spec shortnames as separate priority levels into xref API queries — e.g.[["service-workers-1"], ["service-workers"]]. The xref server doesn't implement true fallback-chain semantics; it searches all levels simultaneously and returns one result per matching shortname, so dual forms produced two results → "ambiguous dfn" → emptyhref.A second bug in
dedupeSpecContextunconditionally pushed even emptyuniqueSpecsarrays (e.g.[["service-workers-1"], []]), which the server may interpret as "search all specs", compounding ambiguity.Changes
src/core/xref.jsstripVersionSuffixandgetUnversionedFallbacksgetSpecContextto push only the spec names as authored — no unversioned fallback injectiondedupeSpecContextto skip empty levels; switched back toSet-based O(1) dedup with an explicitif (uniqueSpecs.length)guard before pushingtests/spec/core/xref-spec.jsservice-workerstests added in fix(core/xref): normalize versioned spec names in data-cite context #5226 into a single "resolves terms with versioned data-cite on container" regression test for issue Same spec version resolution mess #5224 — the versioned shortname still resolves correctly without the fallback machinery