Commit 1c656a5
fix: prevent race condition when navigation changes during head() re-execution
Addresses two scenarios:
1. New navigation starts BEFORE scheduled head() executes
2. New navigation starts WHILE head() is executing
Solution:
- Capture this navigation's location (thisNavigationLocation)
- Before executing head(), check if router's current location matches
- If location changed (new navigation), skip stale head() execution
- Location objects are always unique (parseLocation creates new objects)
Both concerns are resolved:
- Scenario 1: Location check prevents stale head() from executing
- Scenario 2: Stale head() may complete but fresh navigation
overwrites with correct data immediately after
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>1 parent 8df94c1 commit 1c656a5
1 file changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
959 | 959 | | |
960 | 960 | | |
961 | 961 | | |
962 | | - | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
963 | 970 | | |
964 | 971 | | |
965 | 972 | | |
| |||
0 commit comments