Skip to content

need a way to serialize frontend events #6766

Open

Description

@masenf

Describe the Features
Prior to 0.9 reflex only processed one event at a time on the frontend. In 0.9 and later, the main event loop moved to the backend to avoid extra round trips for chained events. In the process, the event_processing flag which serialized event handling on the frontend was removed.

This introduced a race condition for the reflex-enterprise HTTPCookie.sync code which uses rx.call_script to submit fetch() requests to the backend to facilitate cookie syncing. When multiple events are queued around the same time, the requests can race with each other because they are all fired at once. Since the requests bare the cookies they had at the time they were sent, any request that was setting cookies could get those immediately reset when a racing request followed it.

We now have a fix in reflex-enterprise 0.9.2.post1, but it uses a global promise chain and isn't generalizable to other events.

This issue is a placeholder to consider a clean solution for serializing frontend events, possibly within a shared domain, to avoid race conditions like this.

Activity

  1. added
    feature request
    on Jul 15, 2026
  2. linear-code commented on Jul 15, 2026

    @linear-code
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

    feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions