-
Notifications
You must be signed in to change notification settings - Fork 128
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
Unique identifier mechanic is broken #43
Comments
Signed-off-by: Nicos Karalis <[email protected]>
After having to deal with this problem I've managed to solve this problem. At #56 in commit 5090754 should be a fix to this problem. A dictionary (or hash) does not keep the keys in any particular order, so the solution is just sort the keys before using them and append every param to the identified (Channel#uid) This is working fine for me, but I would like if someone else take a look before merging it |
@NicosKaralis thanks for your PR! I was struggling with this bug and found this issue. It helped. |
The last commit that adds the UID mechanic is not working correctly, since it's always relying on the first element of the
identifier
dictionary. The issue happens when the order is different in theJSONSerializer.deserialize
method. We had a regression in iOS 10 because the order of the JSON is different than iOS 11. See below:This cause a problem because the channel's key in
unconfirmedChannels
in this example is the member's uuid (since it's always the first element of the identifier dictionary in thecreate
method, but the message.uid isConversationsChannel
under iOS 10 because that's the first element of the onTexttext
JSON.A quick fix would be to remove the
channel
key, but I think the solution is not really elegant to be honest. We could also create a unique hash using a similar technique like this one:https://github.com/rails/rails/blob/master/actioncable/app/assets/javascripts/action_cable/subscription.coffee#L54
The text was updated successfully, but these errors were encountered: