Skip to content

fix(core/xref): revert getUnversionedFallbacks, fix dedupeSpecContext empty-level bug - #5433

Draft
marcoscaceres with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-node-ci-karma-tests
Draft

fix(core/xref): revert getUnversionedFallbacks, fix dedupeSpecContext empty-level bug#5433
marcoscaceres with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-node-ci-karma-tests

Conversation

Copilot AI commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

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" → empty href.

A second bug in dedupeSpecContext unconditionally pushed even empty uniqueSpecs arrays (e.g. [["service-workers-1"], []]), which the server may interpret as "search all specs", compounding ambiguity.

Changes

  • src/core/xref.js

    • Removed stripVersionSuffix and getUnversionedFallbacks
    • Reverted getSpecContext to push only the spec names as authored — no unversioned fallback injection
    • Fixed dedupeSpecContext to skip empty levels; switched back to Set-based O(1) dedup with an explicit if (uniqueSpecs.length) guard before pushing
  • tests/spec/core/xref-spec.js

… 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
Copilot AI requested a review from marcoscaceres August 25, 2026 07:06
@marcoscaceres marcoscaceres added the AI Contains AI-generated logic; see AI_POLICY.md label Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Contains AI-generated logic; see AI_POLICY.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants