Declare state stores shared by 0.9 and 0.10 instances unsupported
All Submissions:
- Have you followed the guidelines stated in CONTRIBUTING.md file?
- Have you checked to ensure there aren't any other open Pull Requests for the desired changed?
Type of change
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
- This change requires a documentation update
Changes To Core Features:
- Have you added an explanation of what your changes do and why you'd like us to include them?
- Have you successfully ran tests with your changes locally?
What
Declares that instances of Reflex 0.9 and 0.10 cannot share a Redis or disk state store, in a breaking news fragment and a paragraph of the Self Hosting docs (Production Mode). A 0.10 instance still loads state saved by 0.9 (the _legacy_state_schema fallback in _deserialize stays), but a 0.9 instance discards state saved by 0.10, so a rolling deploy that runs both versions, or a rollback to 0.9 against the same store, resets the sessions that reach the older instance. The sentence in news/+field-descriptors.breaking.md claiming that states saved by this release still load in workers of the previous one is removed; it has not held since #7461. The 0.10 upgrade guide gets a matching section in #7496.
The earlier version of this PR, which saved the 0.9 schema hash next to each pickle so 0.9 and 0.10.0a1 workers could load 0.10 state, is reverted. The one code change left goes the other way: BaseState.__getstate__ no longer adds the empty dirty_vars, dirty_substates and _backend_vars entries (_PREVIOUS_RELEASE_PICKLE_KEYS) that only existed so 0.9 workers could restore a 0.10 pickle, which they never get past the schema check to do, so every pickle is a little smaller. __setstate__ still drops those entries, and the _backend_vars dict, from pickles written by 0.9 and 0.10.0a2 workers, so the upgrade path is unchanged.
Closes #7470, which is closed as the decision rather than a fix.
Why
Scope decision by @masenf: keep the 0.9 โ 0.10 state format upgrade, don't carry code that keeps 0.10 states readable by older instances. Mixed-version fleets on one store are unsupported from 0.10 on, and the fragment and docs make that explicit instead of leaving the silent session resets found by the 0.10.0a2 pre-release QA (prerelease_testing/2026-10-07/reverify_core/verification/n004-schema-rollback/ on claude/reflex-prerelease-testing-t0sd90).
Test plan
test_getstate_holds_only_the_fields_of_the_stateasserts a pickle carries no entry for older workers;test_setstate_migrates_older_pickles,test_setstate_drops_inherited_fieldsandtest_deserialize_previous_schema_formatkeep covering the 0.9 โ 0.10 load path.tests/units/test_state.pyand the pickle, schema, Redis and disk tests undertests/units/istatepass; pre-commit on the changed files passes (ruff, codespell, pyright, ty, update-pyi-files).
๐ค Generated with Claude Code
https://claude.ai/code/session_01SjCrbdguMkfe4bhbaREiwo
Generated by Claude Code