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

Unnecessary JSON.stringify when sending signals? #76

Open
2 tasks done
caffodian opened this issue May 18, 2020 · 1 comment
Open
2 tasks done

Unnecessary JSON.stringify when sending signals? #76

caffodian opened this issue May 18, 2020 · 1 comment
Assignees

Comments

@caffodian
Copy link

New issue checklist

General information

  • Library version(s): 2.0.15
  • iOS/Android/Browser version(s): any
  • Devices/Simulators/Machine affected: all
  • Reproducible in the demo project? (Yes/No): any
  • Related issues:

Bug report

the signal sender always stringifys the signal data, but the core library and servers are able to take Objects as is. This means that for signals send using the accelerator, an extra parse is needed that isn't necessarily when sending identical signals from non-accelerator client, or from the server.

https://github.com/opentok/accelerator-core-js/blob/master/src/core.js#L590

Expected behavior

  • data is passed through as is

Actual behavior

  • data is passed through as a string

Steps to reproduce

  • send a signal with accelerator's signal function, pass an object as data
  • receive that signal - you will need to JSON.parse the data field

Question or Feature Request

Is this by design? It doesn't appear to be a documented difference. feels like it shouldn't be happening, but maybe users of this library are used to this by now?

@michaeljolley michaeljolley self-assigned this Jul 19, 2020
@michaeljolley
Copy link
Contributor

@caffodian this makes a lot of sense. Thanks for the input. I'm working on this change now, but it may be a bit before it's in the wild. I imagine this will require a major version change as it could potentially break dependent apps.

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

2 participants