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

More encoding / decoding examples #11

Open
mattheworiordan opened this issue Dec 2, 2015 · 3 comments
Open

More encoding / decoding examples #11

mattheworiordan opened this issue Dec 2, 2015 · 3 comments

Comments

@mattheworiordan
Copy link
Member

See ably/ably-cocoa#95, I think client library developers will generally struggle to understand the spec and implement exactly as we expect.

As such, I recommend we introduce a new JSON file in https://github.com/ably/ably-common/tree/master/test-resources which includes all permutations of non-encrypted encodings & decodings to remove any ambiguity about what is expected.

@paddybyers @SimonWoolf WDYT? This should not change the spec, but I can add a note in the encoding & decoding that is helps to run the tests against the JSON file.

@paddybyers
Copy link
Member

which includes all permutations of non-encrypted encodings & decodings to remove any ambiguity about what is expected.

Yes, but really we want examples that map a Message, or at least a data, to an encoded Message or ProtocolMessage, so it is obvious how the arguments presented in the API get turned into serialised entities. But .... we can't put binary data into a JSON file, so we need the file to include an extra level of encoding to be able to contain the data and the serialised entity. That could just add even more confusion unless we explain it carefully ...

@SimonWoolf
Copy link
Member

👍 there's a few in ably-js here, but yeah, putting it all with expected decoded result in a common file is a good idea

@mattheworiordan
Copy link
Member Author

Yes, but really we want examples that map a Message, or at least a data, to an encoded Message or ProtocolMessage

I don't see why a ProtocolMessage is relevant given it will contain an array of Message objects, and encoding & decoding is contained within the Message

But .... we can't put binary data into a JSON file, so we need the file to include an extra level of encoding to be able to contain the data and the serialised entity. That could just add even more confusion unless we explain it carefully ...

How is that any different to https://github.com/ably/ably-common/blob/master/test-resources/crypto-data-256.json#L9-L18?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants