Skip to content

fix(zero-cache): ignore pushes for closed connections - #6416

Open
jdnvn wants to merge 1 commit into
rocicorp:mainfrom
jdnvn:fix/pusher-closed-connection-race
Open

fix(zero-cache): ignore pushes for closed connections#6416
jdnvn wants to merge 1 commit into
rocicorp:mainfrom
jdnvn:fix/pusher-closed-connection-race

Conversation

@jdnvn

@jdnvn jdnvn commented Aug 26, 2026

Copy link
Copy Markdown

when Zero encounters a connection error (e.g. outdated client schema) it invalidates the WebSocket's authentication context and begins closing the connection. during this time, if a custom mutation is pushed, it will call mustGetConnectionContext() and since the shutdown removed the context, Zero will throw the following error:

Connection auth state was not available for this websocket.

this PR fixes this by checking whether the connection context exists before pushing the mutation. if the context exists, we proceed with the push. if it does not exist, that means the connection is closing, so we drop the invocation and leave it to be retried by the client upon reconnecting.

@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

@jdnvn is attempting to deploy a commit to the Rocicorp Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant