fix(state): recover from unknown frontend substates
Merged
KR
22d ago+210+210+012345678901234567890123456789-106-106-012345678901234567890123456789
Summary
Fixes #7247.
When a backend delta named a substate the page never registered, the frontend latched backend_state_mismatch and stopped applying updates and sending events for the rest of the session. This skips unknown substates so the rest of the delta still applies and the session stays usable.
What changed
- Apply known state and browser storage updates while excluding unknown substates.
- Report each unknown substate name once per connection through the existing frontend exception handler.
- Cover mixed deltas, hydration, returned events and continued clicks with runtime and browser regressions.
- Update the exception handler docs and add news fragments for
reflexandreflex-base.
Verification
- Full unit suite: 11,186 passed, 155 skipped, 78.96% coverage.
- Playwright integration tests in
test_client_error.py: eight passed across dev and prod. - Ruff,
pyright reflex tests, Ty, Biome, stub generation and the staged pre-commit hooks pass. - Full
pre-commit run --all-filesreports six type errors from Linux-only CPU affinity APIs in benchmark files this PR doesn't touch. They reproduce on unchangedmainon macOS.
Deployment notes
The frontend needs a rebuild to pick up the runtime change. Recovery only skips unknown substates; it does not reconcile other incompatible state definitions between frontend and backend.