Skip to content

modify state on a SharedState token warns "disconnected client" for every update #7913

Closed

Description

@bertbarabas

On Reflex 0.11.0 (still present on main), App.modify_state(rx.BaseStateToken(ident=shared_token, cls=SharedState)) from a background task or API route logs this on every call:

Warning: Attempting to send delta to disconnected client '<shared_token>'

The quoted value is the shared-state ident, not a browser session token. No websocket is ever registered for it. Linked clients still receive the update through _do_update_other_tokens, and the shared state is persisted, so the warning does not match a failed delivery.

App.modify_state always ends with emit_update(..., token=token.ident). For a shared token, token.ident is absent from token_to_socket, and the in-memory token manager logs the warning. Issue #6335 called for skipping that emit; #6336 added linked-client fan-out and left the emit in place.

Expected: when the token is a shared-state ident, persist the state and fan out to _linked_from, and do not emit to the shared ident or log a disconnect warning. A real browser token that has disconnected should still warn.

Activity

  1. linear-code commented on Nov 16, 2026

    @linear-code
  2. added
    bug
    on Nov 16, 2026
  3. added a commit that references this issue on Nov 20, 2026
    465527b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions