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

infinite loop with event named 'data' #10

Closed
wants to merge 7 commits into from

Conversation

fzanaroli
Copy link

In our use case the Server-Sent event we send from our server is called 'data'

  event: data
  data: { whatever }
  id: 9e7472c3-9ac2-431a-bf42-0ff671ecac38

this lead to an infinite loop in the polyfill as ondata callback exists in the implementation.

Solution : rename the ondata callback: 'ondata' became '_onxhrdata' in order to avoid any collision with existing event name.

fzanaroli and others added 7 commits May 29, 2015 10:08
for streamdataio proxy we chose 'data' as snapshot event name. This leads to an infinite loop in the implemetation as dispatchevent call ondata callback instread of onmessage callback.
…e is 'data'

handle events through message callback
an ondata callback existed in the implementation leading to a infinite loop with sreamdataio as data is on of the event name.

Rename the ondata callback to _onxhrdata to avoid any collision with event names
mistakenly removed in previous commit
revert changes regarding test suite
@amvtek
Copy link
Owner

amvtek commented May 30, 2015

Hello,
this make sense & the bug was not detected.
We will do a code review & merge changes after rerunning test suite.

Thank you for your help.
AmvTek

amvtek added a commit that referenced this pull request May 30, 2015
…where event named data created an infinite loop
@amvtek
Copy link
Owner

amvtek commented May 30, 2015

Your changes were merged in master.
New release 0.9.7 was published which integrates those changes.
Thank you for your help.
AmvTek

@amvtek amvtek closed this May 30, 2015
@fzanaroli
Copy link
Author

Great.

Thanks for this quick merge :)

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

Successfully merging this pull request may close these issues.

2 participants