Repository navigation
test(router): pin skipped-loader-stays-matched in resolveLoadersOnlyWithRevalidation - #579
Merged
Merged
Conversation
…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.
commit: |
6 tasks
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.
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 itsrevalidate()returned false), the loader is dropped from the emitted segments (not re-fetched) but its id stays inmatchedIds. 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 throughmatchedIdswould have gone uncaught.Test plan
pnpm run test:unit— green (the new case + the existing run/dedup/parallel cases)