Skip to content

Conversation

@WillSewell
Copy link
Contributor

If the auth endpoint returns channel_data, then this should be
forwarded to the auth endpoint even if it is not used by private
channels currently.

This is useful because it allows the same auth endpoint to be
used for private and presence channels.

It also avoids confusing auth signature errors that occur when the
channel_data is not sent (but the auth signature was computed from
it).

Fixes #144.

In order to support the getMe() method on PresenceChannel, we need
to store the channel_data in the PrivateChannelImpl class. This
is decoded in the PresenceChannelImpl class since presence channels
require the channel_data is JSON. It is decoded in toSubscribeMessage()
rather than getMe() to preserve the original semantics (e.g.
exceptions cannot be thrown from getMe().


CC @pusher/mobile

If the auth endpoint returns channel_data, then this should be
forwarded to the auth endpoint even if it is not used by private
channels currently.

This is useful because it allows the same auth endpoint to be
used for private and presence channels.

It also avoids confusing auth signature errors that occur when the
channel_data is not sent (but the auth signature was computed from
it).

Fixes #144 #144 #144.

In order to support the getMe() method on PresenceChannel, we need
to store the channel_data in the PrivateChannelImpl class. This
is decoded in the PresenceChannelImpl class since presence channels
require the channel_data is JSON. It is decoded in toSubscribeMessage()
rather than getMe() to preserve the original semantics (e.g.
exceptions cannot be thrown from getMe().
Changed storeMyUserId to extractUserIdFromChannelData and moved
the side effect of storing the id into toSubscribeMessage.
Copy link
Contributor

@TomKemp TomKemp left a comment

Choose a reason for hiding this comment

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

I changes look good. I have just left some comments about redundant code.

Co-Authored-By: Tom Kemp <TomKemp@users.noreply.github.com>
@WillSewell WillSewell merged commit 8d8d70a into master Sep 16, 2019
@WillSewell WillSewell deleted the forward-channel-data-on-private-channels branch September 16, 2019 15:43
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.

can't subscribe to private channels

4 participants