You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A cancelled foreground supersedes=True handler loses all of its state writes under StateManagerRedis but keeps them under the in-memory manager #7248
StateManagerRedis._try_modify_state (reflex/istate/manager/redis.py:487-494) calls set_state only after the yield state body returns normally. When a foreground handler is cancelled mid-await by a superseding event, the CancelledError thrown into the body skips the write-back, so every mutation the handler made before cancellation is lost, including one it had already yielded as a delta. StateManagerMemory keeps those writes. The variable is the state manager, not dev vs prod or the worker count.
To Reproduce
Foreground handler frefresh with supersedes=True: append F{tag}:start to a list var, yield, await asyncio.sleep(2), append F{tag}:done. Fire A then B within 2 s. Same dev build, same app, one worker; toggle only REFLEX_REDIS_URL.
redis: ["FB:start", "FB:done"] (FA:start never reaches redis or the client)
Controls in the same runs: a completed foreground handler and the background variant keep their writes under redis on both versions.
Expected behavior
Consistent semantics between the two managers: flush the pre-cancellation writes under redis, or document that a cancelled handler's writes are discarded there.
Specifics
Reflex 0.9.12a1; not a regression: identical on 0.9.11.post1 + redis
redis-server 7.0, Python 3.11.15, Linux
Additional context
0.9.12a1 pre-release QA, FINDING-016, refuted as a release issue by the adversarial verifier (pre-existing, LOW) and recorded as an upstream semantics issue. Evidence in event_loop/: elapp page /supersede, out/supersede.txt, out_prod/supersede.txt, and the verifier's memory/redis/baseline runs under verification/. Full write-up: FINDINGS.md.
Activity
linear-code commentedon Sep 22, 2026
ENG-12642