Skip to content

test(router): pin skipped-loader-stays-matched in resolveLoadersOnlyWithRevalidation - #579

Merged
ivogt merged 1 commit into
mainfrom
test/loader-skipped-matchedids-pin
Jun 14, 2026
Merged

ivogt merged 1 commit into
mainfrom
test/loader-skipped-matchedids-pin

Conversation

@ivogt

@ivogt ivogt commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Coverage-only. Surfaced while exploring the #568 sub-item-1 fresh/revalidation traversal unification (experiment dropped — the deeper twins aren't a real dedup). This pinning test is independently valuable and lands on its own.

What it locks

The revalidation loader-collection path (resolveLoadersOnlyWithRevalidation) has a deliberate divergence from the fresh path: when a loader's gate says skip (it's already in the client's segment set and its revalidate() returned false), the loader is dropped from the emitted segments (not re-fetched) but its id stays in matchedIds. That keeps the client advertising it, so it isn't pruned and remains eligible for future revalidation. Without it, the loader falls out of the client set, gets force-refetched on the next request, and churns.

The existing suite covered loaders that run (and their matchedIds), but never the skipped case — so a regression that stopped threading skipped ids through matchedIds would have gone uncaught.

// loader already in the client set, revalidate() -> false
result.segments   // [] — not re-fetched
result.matchedIds // ['L0D0.parallel-loader'] — still matched

Test plan

  • typecheck / lint / format
  • pnpm run test:unit — green (the new case + the existing run/dedup/parallel cases)
  • No behavior change; test-only.

…ithRevalidation

The revalidation loader path drops a skipped loader from the emitted segments
but keeps its id in matchedIds, so the client keeps advertising it and it stays
eligible for future revalidation (otherwise it is pruned, force-refetched next
request, and churns). The suite covered loaders that RUN but never the skipped
case; this pins it: a loader already in the client set whose revalidate()
returns false -> 0 segments, but its id remains in matchedIds.

Coverage only; no behavior change.
@pkg-pr-new

pkg-pr-new Bot commented Jun 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@rangojs/router@579

commit: 01196f2

@ivogt
ivogt merged commit 554e249 into main Jun 14, 2026
25 checks passed
@ivogt
ivogt deleted the test/loader-skipped-matchedids-pin branch June 14, 2026 07:00
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.

1 participant