Avoid root dirty delta for shared state events - #6841
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Merging this PR will not alter performance
Comparing Footnotes
|
Greptile SummaryThe PR prevents temporary router dirtiness used during linked/shared-state patching from leaking into regular event deltas and now restores dirty-state bookkeeping when delta resolution fails.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the current exception handler restores every pre-snapshotted descendant’s dirty sets, while the finally block restores the root dirty sets for failures and cancellations.
|
| Filename | Overview |
|---|---|
| reflex/istate/shared.py | Preserves temporary dirty-state bookkeeping around linked-state delta resolution, including exception and cancellation paths. |
| tests/units/test_state.py | Adds focused regression coverage for normal root cleanup and exceptional root/descendant cleanup. |
| news/6841.bugfix.md | Documents the linked/shared-state dirty-delta fix. |
Reviews (6): Last reviewed commit: "Restore descendant dirty state on linked..." | Re-trigger Greptile
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Summary
Tests
uv run --frozen pytest tests/units/test_state.py::test_linked_state_event_does_not_dirty_root_state -quv run --frozen pytest tests/units/test_state.py::test_linked_state_event_does_not_dirty_root_state tests/units/test_state.py::test_router_var_dep tests/units/test_state.py::test_computed_var_depends_on_parent_non_cached tests/units/test_state.py::test_async_computed_var_get_state -quv run --frozen pytest tests/units/test_state.py -quv run --frozen pre-commit run --files reflex/istate/shared.py tests/units/test_state.py news/6392.bugfix.mdCloses #6392