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

[SDK-3910] Fix RealtimePresence#leave handling of PresenceMessage argument #1466

Merged

Conversation

lawrence-forooghian
Copy link
Collaborator

RealtimePresence’s enter*, update* and leave* methods all advertise themselves as accepting a PresenceMessage instance instead of just a data object. This is the only way that ably-js supports passing message extras to these methods.

However, leave does not handle a PresenceMessage argument properly; it ends up nesting the PresenceMessage’s top-level fields inside the payload’s data property.

To fix this, we change the argument handling to match that used by enter.

Resolves #1465.

RealtimePresence’s `enter*`, `update*` and `leave*` methods all
advertise themselves as accepting a PresenceMessage instance instead of
just a data object. This is the only way that ably-js supports passing
message extras to these methods.

However, `leave` does not handle a PresenceMessage argument properly; it
ends up nesting the PresenceMessage’s top-level fields inside the
payload’s `data` property.

To fix this, we change the argument handling to match that used by
`enter`.

Resolves #1465.
@lawrence-forooghian lawrence-forooghian changed the title [SDK-3910] Fix RealtimePresence#leave handling of PresenceMessage argument [SDK-3910] Fix RealtimePresence#leave handling of PresenceMessage argument Oct 20, 2023
@lawrence-forooghian lawrence-forooghian marked this pull request as ready for review October 20, 2023 19:59
Copy link
Member

@owenpearson owenpearson left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@lawrence-forooghian lawrence-forooghian merged commit 73a86a3 into main Oct 23, 2023
11 checks passed
@lawrence-forooghian lawrence-forooghian deleted the 1465-presence-leave-handle-presence-message branch October 23, 2023 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

RealtimePresence#leave is broken when passing a PresenceMessage instance
2 participants