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

Contracts aren't synced when we come back online #2666

Closed
taoeffect opened this issue Feb 23, 2025 · 0 comments · Fixed by #2670
Closed

Contracts aren't synced when we come back online #2666

taoeffect opened this issue Feb 23, 2025 · 0 comments · Fixed by #2670
Assignees
Labels
App:Frontend Kind:Bug Kind:Core Anything that changes or affects the fundamental core data structures & design of the application. Note:UI/UX Priority:High

Comments

@taoeffect
Copy link
Member

taoeffect commented Feb 23, 2025

Problem

Related to this Review: #2660 (comment)

Contracts are not sync'd when we come back online. It was thought that this happened here in chelonia.js:

        'subscription-succeeded': (event) => {
          const { channelID } = event.detail
          if (this.subscriptionSet.has(channelID)) {
            // For new subscriptions, some messages could have been lost
            // between the time the subscription was requested and it was
            // actually set up. In these cases, force sync contracts to get them
            // updated.
            sbp('chelonia/private/out/sync', channelID, { force: true }).catch(err => {
              console.warn(`[chelonia] Syncing contract ${channelID} failed: ${err.message}`)
            })
          }
        }

But this 'subscription-succeeded' is the wrong event.

So for example, as mentioned in the review, being offline and someone changing their display name, then coming back online, doesn't show the change.

Solution

Listen to the correct event, the one for when we come back online.

@taoeffect taoeffect added App:Frontend Kind:Bug Kind:Core Anything that changes or affects the fundamental core data structures & design of the application. Note:UI/UX Priority:High labels Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App:Frontend Kind:Bug Kind:Core Anything that changes or affects the fundamental core data structures & design of the application. Note:UI/UX Priority:High
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants