Document that writing an inherited var outside `async with self` now raises

Merged
MA
24d ago
+3-1

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

  • 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 written new tests for your core changes, as applicable? (docs only)
  • Have you successfully ran tests with your changes locally? (pre-commit)

What and why

This is finding A3-06 from the 0.10.0a3 pre-release re-verification. It is a docs gap that an independent verifier confirmed, and two exploration clusters found it independently.

The "Upgrading to Reflex 0.10" guide and the #7312 changelog entry cover calling an inherited handler from a background task. They miss that writing a var inherited from a parent state outside async with self now raises ImmutableStateError. That holds both for a direct assignment such as self.count += 1 on a Child whose count is declared on Parent, and for a write through any handler, including one declared on the task's own state.

On 0.9.12 that write raised nothing:

  • with the in-memory state manager it landed without the lock;
  • with Redis it was silently discarded, so the value stayed unchanged in the UI and after a reload.

In-place mutation of an inherited list already raised on 0.9.12; only attribute assignment slipped through.

0.10 is the safe behaviour, and it now matches background_events.md, which always said writes outside the block raise. Users upgrading should still hear about it.

Changes

  • docs/changelog/upgrading/upgrading-to-0-10.md: one paragraph in "Calling inherited handlers from background tasks". The heading stays, because background_events.md and the changelog entry link to its anchor.
  • news/7312.breaking.md: the same point in one sentence. The fragment is still unreleased.
  • docs/app/news/+upgrade-guide-inherited-var-writes.docs.md: fragment for the docs site.

Evidence

Repros live in prerelease_testing/2026-10-07-a3 on the campaign branch:

  • a3_upgrade/apps/guide with bin/seq_guide2.sh: 0.9.12 goes 14 โ†’ 114 with no error; a3 raises.
  • a3_events_tp/events/src/n024doc runs the guide's own Parent/Child sample.
  • The verifier's three-level app, which also produced the Redis data-loss refinement.

Details are under A3-06 in FINDINGS.md.

๐Ÿค– Generated with Claude Code

https://claude.ai/code/session_01SjCrbdguMkfe4bhbaREiwo