Repository navigation
fix(loading): ignore a component import from before stop - #113
Conversation
A failed load can leave its component import running. After stop, the next load starts again at fetch count 1, so the old import replaced the new module. Accept a component result only when the stored match still uses that load's abort signal. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesReject component results whose load signal no longer belongs to the stored route match. Example: A page preload fails while its component remains pending, then stop and another preload load a replacement component.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current loading bug with a focused ownership check; no actionable defects were found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe framework-independent router coordinates navigation and preloads, runs application component and data functions, and publishes active, pending, and cached matches. flowchart TD
A[Navigation or preload] --> B[Route match and controller]
B --> C[Parallel component and data loading]
C --> D[Fetch ownership check]
D --> E[Match store]
E --> F[Application subscribers]
G[Stop] --> B
G --> E
Technical reviewBest possible solution: Retain the signal identity check in the existing fetch predicate and land the focused regression test and changelog entry. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the fetch-count collision after failed preload cleanup, and the contributor supplies matching before-and-after package output; no reproduction was executed during this review. Is this the best way to solve the issue? Checking the stored match's existing signal is the smallest complete repair and preserves valid preload sharing, component-first publication, and background revalidation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5acce8720c86. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 20, 2026, 8:12 AM ET / 13:12 UTC. |
…replay * origin/main: fix(history): replace the URL on an unmatched redirect (#115) refactor(tests): consolidate pending invalidation scenarios (#118) fix(loading): accept redirect records without a route location as data (#116) fix(loading): ignore a component import from before stop (#113) # Conflicts: # CHANGELOG.md
What Problem This Solves
Fixes: a component import that is still running when the router stops can replace the module loaded after restart.
User Impact
User impact: after stop and a new preload, a late component import from the previous session no longer overwrites the module. The new loader data stays in place.
Why This Change Was Made
A failed loader does not abort the component import.
stop()clears the module cache, and the next match starts again at fetch count 1, so the old import looked current. A component result is now accepted only when the stored match still uses that load's abort signal.The fetch-count guard was rewritten in #90 without comparing the signal. #110 covers the case where the old import rejects.
Evidence
Terminal output from
nodeagainst the built package. The same public calls ran before the patch and after it.Before, the late import replaced
replacementwithstale modulewhile data stayedfresh:After, the module stays
replacement:Real behavior proof
The same command on the previous package printed module
stale moduleafter the late import.freshand modulereplacementafter the old import resolves. The component function ran twice.