Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add sequence number of subscriptions revision #187

Open
wants to merge 1 commit into
base: main-lfs-DO-NOT-USE
Choose a base branch
from

Conversation

chris13524
Copy link
Member

@chris13524 chris13524 commented Dec 23, 2023

Context

Fixes #185

Problem

There is a race condition if multiple subscription updates happen at the same time that a client will receive them out-of-order and display an outdated version.

Solution

Notify Server will now store a version for the subscriptions list. I.e. everytime a subscription is updated (in a way that would trigger subscriptions changed e.g. a subscribe, update, or delete), then this sequence number will also be incremented.

The sequence number is sent to the account alongside the list of subscriptions which clients will then store with their local list of subscriptions. Whenever the client processes an incoming sbs value it must first check the sequence number, and if it is smaller than the current number then it must disregard the update.

Copy link

vercel bot commented Dec 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
walletconnect-specs ✅ Ready (Inspect) Visit Preview Dec 23, 2023 9:37am

Copy link
Contributor

@flypaper0 flypaper0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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.

Notify watch subscriptions race condition
3 participants