-
Notifications
You must be signed in to change notification settings - Fork 31
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
Data sent as []byte should be decoded as []byte #581
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add one more msgpack integration test that sends binary data and checks on another side if data is received in the required format?
done in 68c0afe |
Are we waiting for anymore changes on this PR? I remember there was issue the msgpack library for encoding/decoding data? |
Yes, I am adding some more fixture tests. Should be done by the end of the weekend. But the SDK team will need to discuss what we do with this PR, as it will break current behaviour (see PR comment). |
…nd encoding of binary messages of different payload types and lengths.
I am going to close this for now as it is a breaking change, which will cause currently working code to panic at runtime. |
Fixes #574
The spec states:
(RSL6a) All messages received will be decoded automatically based on the encoding field and the payloads will be converted into the format they were originally sent using i.e. binary, string, or JSON
In this case the message was sent as []byte so should have been received as as []byte.
This PR fixes the behaviour when receiving a
[]byte
message.The problem is that merging this PR could cause user code to panic at runtime, if it assumes the old incorrect behaviour
and does something like
payload := msg.Data.(string)
Is this a breaking change which requires a new major version?
How many customers are using ably-go to receive realtime messages?
The SDK team will need to decide.