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

Presence messages superseded whilst channel in attaching state #908

Closed
AndyTWF opened this issue Feb 1, 2023 · 1 comment · Fixed by #909
Closed

Presence messages superseded whilst channel in attaching state #908

AndyTWF opened this issue Feb 1, 2023 · 1 comment · Fixed by #909
Assignees
Labels
bug Something isn't working. It's clear that this does need to be fixed.

Comments

@AndyTWF
Copy link
Contributor

AndyTWF commented Feb 1, 2023

presence.enter and presence.update (and the others) call presence.updatePresence.

updatePresence will put messages on a queue to be sent later, in the event that the channel is currently attaching. This queue is a HashMap that is keyed by clientid. This means if a presence.enter and presence.update occur in quick succession before the channel attaches, the former is cancelled out by the latter (and any listeners are not called).

There are two possible options:

  1. Queue up all presence messages and then send in-order on channel attach.
  2. Only send the latest message, but call all event listeners with the result.

The spec needs updating to provide more clarification on what the behaviour should be (see: ably/specification#130), but the current implementation in ably-js is to just send all of the pending messages.

@AndyTWF AndyTWF added the bug Something isn't working. It's clear that this does need to be fixed. label Feb 1, 2023
@AndyTWF AndyTWF self-assigned this Feb 1, 2023
@sync-by-unito
Copy link

sync-by-unito bot commented Feb 1, 2023

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3303

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. It's clear that this does need to be fixed.
Development

Successfully merging a pull request may close this issue.

1 participant