Repository navigation
Conversation
Dropping a match whose retention already elapsed removed the timer from the map without clearing it. stop only clears timers still in the map, so the preload timer stayed armed. Clear it before deleting the map entry. 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 changesThis PR clears an outstanding preload retention timer before immediately expiring its match and preserves newer timer registrations when an older callback finishes. Example: With gcTime 0 and preloadGcTime 60000, preload chat, navigate to chat, navigate to other, then stop.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current timer-cleanup defect with a focused change; no actionable correctness or security findings remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherPublic preload and navigation calls feed the router's match store and loading subsystem, which manage cached matches and host timers; stop releases their resources. flowchart TD
A[Public router calls] --> B[Navigation and preload]
B --> C[Match store]
B --> D[Route loading]
D --> C
D --> E[Retention timers]
F[Router stop] --> D
F --> C
Technical reviewBest possible solution: Land the focused timer cleanup while preserving existing retention semantics and public APIs. Do we have a high-confidence way to reproduce the issue? The public-call sequence is explicit, current-main source explains the lost timer registration, and the contributor supplies matching before/after built-package output; review did not execute target code. Is this the best way to solve the issue? Clearing the existing timer in its owning expiry branch directly repairs the resource leak without changing cache policy, adding dependencies, or introducing another lifecycle owner. 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. |
|
Thanks for finding and fixing this. The timer leak reproduced on current main (one timer remained after stop) and is now fixed in #112 / 760e341, with your contributor credit preserved. The regression passes, the complete 83-test package gate passes, and Linux/macOS/Windows CI is green. Closing this superseded PR. |
What Problem This Solves
Fixes: stop leaves a preload retention timer armed when navigation cache expiry is immediate.
User Impact
User impact: after a preloaded route is shown and then left, stop clears that retention timer instead of leaving it scheduled.
Why This Change Was Made
When retention has already elapsed, the timer id was removed from the map without clearing the timer. stop only clears timers that are still in the map. The immediate-expiry path now clears the timer first. A firing callback also leaves a newer timer registered.
The expiry path has skipped the clear since the router match loading refactor on 2026-06-20 (
f047b64, 153 days). That commit has no linked pull request. The infinite-retention path in the same function already clears its timer.Evidence
Terminal output from
nodeagainst the built package. The same public calls ran before the patch and after it.Before, one timer was still armed after stop, and the match was not cached:
After, stop leaves no timer armed:
Real behavior proof
/chat, navigate to/chat, navigate to/other, then stop. Count timers that were scheduled and not cleared.The same command on the previous package printed
armedTimersAfterStop1.