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

Binary Data event names incorrectly handled #426

Open
kitgxrl opened this issue Apr 29, 2024 · 1 comment
Open

Binary Data event names incorrectly handled #426

kitgxrl opened this issue Apr 29, 2024 · 1 comment

Comments

@kitgxrl
Copy link

kitgxrl commented Apr 29, 2024

Currently if there is some additional data attached to a binary event, it is not possible to retrieve that additional data, e.g xxx["my_binary_event", "extra data"] is not correctly handled. The worst case scenario is that the event name is labelled entirely wrong. In the previous example the library currently just strips the brackets and ", which would cause an event name of: my_binary_eventextra data or something along those lines.

@kitgxrl
Copy link
Author

kitgxrl commented Apr 29, 2024

In order to fix this while extracting the additional data I see three solutions:

  1. Introduce Payload::BinaryText(Bytes, Vec<Value>)
  2. Change Payload::Binary(Bytes) to Payload::Binary(Bytes, Vec<Value>) (Potentially Option<Vec<Value>> for easier checking?)
  3. Emit both Payload::Text and Payload::Binary separately

1 sounds the best as it does not break the existing API and is easier to handle when both the binary data and additional Text data are related.

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

No branches or pull requests

1 participant