Repository navigation
fix: preserve redux cache when updating url state - #4349
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues remain, and regression coverage is included.
Pull request overview
Updates URL-backed Redux state synchronization to preserve unchanged Redux and RTK Query cache references.
Changes:
- Replaces deep cloning with
createNextState. - Adds navigation, URL synchronization, query preservation, and history regression tests.
File summaries
| File | Description |
|---|---|
src/store/state-url-mapping.ts |
Preserves unchanged state references during URL merges. |
src/store/state-url-mapping.test.ts |
Tests navigation and cache-reference preservation. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Approve — reviewed c06612f7.
No introduced issues found. The missing- |
|
Reviewed c06612f against base 38b6856. What was checked
Optional, non-blocking
Verdict: approve — the notes above are optional. |
Navigation currently deep-copies the entire Redux state when merging URL-backed fields, including unchanged RTK Query cache data. With large disk responses, this adds unnecessary work and invalidates references used by selectors even when mapped URL values do not change.
Use Redux Toolkit's
createNextStateto merge only the URL-backed changes while preserving unchanged state and API cache references. Regression tests exercise the real location middleware and reducer wrapper: navigation with no mapped changes, URL-to-state updates, state-to-URL updates, preserved runtime query parameters, and browser back/forward history.Extracted from #4348. This PR targets
mainand has no dependency on compact PDisk previews.Validation:
npm run typecheckpassed.npm run lintpassed (0 errors; 219 warnings).npm test -- --runInBandpassed: 217 suites, 1927 tests.npm run build:embeddedandnpm run packagepassed.git diff --checkpassed.The changed URL-state flow preserves cached Redux data references and correctly updates URL-backed fields during navigation and history traversal.
What we checked:
Summary
Reviews (1) · Last reviewed commit: "fix: preserve redux cache when updating ..."