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 SummaryThis PR prevents temporary router dirtiness used during linked/shared-state patching from leaking into regular event deltas and now restores that dirtiness when resolution raises.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously reported exceptional-resolution leak is addressed by nested finally blocks that restore both dirty state and patched tree links, with regression coverage for the error path.
|
| Filename | Overview |
|---|---|
| reflex/istate/shared.py | Preserves root dirty-state snapshots around temporary router-dependent delta resolution and restores them in a finally block for regular linked-state events. |
| tests/units/test_state.py | Adds focused regression tests covering clean regular-event deltas and dirty-state/tree-link restoration after resolution errors. |
| news/6841.bugfix.md | Documents the linked/shared-state temporary router-dirtiness fix. |
| news/6836.misc.md | Reclassifies an existing changelog entry from chore to misc. |
Reviews (3): Last reviewed commit: "Use valid news fragment type for Pillow ..." | 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