Closed jabools closed 5 months ago
Working on test fixes.
@jabools I'm pretty happy with the implmentation after a couple of tweaks, but interested if you can point me to the part of the Pusher docs which says this is a requirement. I can only see it in the Presence channel docs which we already handle and I'm reluctant to send more data across the wire than necessary.
Unfortunately, I am not able to find anything that would make that property a requirement. As Pusher's docs state:
All events received and sent by clients can contain a data field. [...] In order to keep the protocol consistent, Pusher Channels tries to send the data field as a string.
it is not mandatory for events to have data
property and there are only information about data
property for presence channels. However, I believe it's worth considering providing it in private channels as the official Pusher API provides it and also their official Swift package ignores subscription_succeeded
event if there is no data provided (https://github.com/pusher/pusher-websocket-swift/blob/master/Sources/Services/PusherConnection.swift#L448). The latter may be (of course) a bug, but for now they are complementary for one another.
It also looks like every pusher internal event contains data
property, which is reasonable - they contain the actual data. This may be some kind of common algorithm and they do the same also for subscription_succeeded
event - but this is just an allegation :)
Thanks @jabools - would you be able to test this branch and see if it resolves all of your issues?
@joedixon I'm responding from my work account :) I've just tested this branch and it works like a charm - iOS application works as expected, web application also works well and no side effects were noticed.
This PR fixes missing
data
property forpusher_internal
events.Fixes #123