When a user switches projects quickly, the previous navigation may still be in progress when a new navigation is triggered. In some cases, the navigation gets discarded/cancelled before it completes.
However, the main navigation menu component still updates to display the newly selected project, even though the corresponding navigation never successfully completed. This leaves the UI in an inconsistent state where the selected project in the menu does not match the actual active project/page.
Suspected root cause
The selected project state appears to be updated optimistically before navigation has successfully completed. If the navigation is later cancelled or fails, the state is not rolled back to the previous value.
Expected behavior
The navigation menu should only reflect the new project after navigation succeeds, or the state should be reverted if navigation is cancelled/fails.
Possible areas to investigate
- Optimistic state updates in the project selector/navigation flow
- Race conditions between consecutive navigation requests
- Missing rollback/error handling for cancelled navigations
- Synchronization between router state and navigation menu state
When a user switches projects quickly, the previous navigation may still be in progress when a new navigation is triggered. In some cases, the navigation gets discarded/cancelled before it completes.
However, the main navigation menu component still updates to display the newly selected project, even though the corresponding navigation never successfully completed. This leaves the UI in an inconsistent state where the selected project in the menu does not match the actual active project/page.
Suspected root cause
The selected project state appears to be updated optimistically before navigation has successfully completed. If the navigation is later cancelled or fails, the state is not rolled back to the previous value.
Expected behavior
The navigation menu should only reflect the new project after navigation succeeds, or the state should be reverted if navigation is cancelled/fails.
Possible areas to investigate