You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.
First of all, thanks @jordanbyron for the great work you've done! 👏
I noticed a strange issue on my end. Long story short - the same MessageEvent is getting dispatched via the EventSource over and over again, even though the back-end is not emitting a new message.
Here's the MessageEvent which gets dispatched:
{
data: "large stringified object with `creationDate` (timestamp) which the server sends"
lastEventId: ""
origin: undefined}
I'm sure that my back-end is not emitting a new message because I also have a web interface where I can test, wired up with the EventSource Web API, where the issue doesn't occur. Moreover the creationDate timestamp in the MessageEvents data I'm receiving from my server and all the other params are absolutely the same.
On my end, this is causing performance issues, because it triggers my sseSource.addEventListener logic I have over and over again every minute or so (there is around 1 min delay until all of the same events get dispatched again, so strange?).
My implementation is quite straight-forward, nothing special I think:
I tend to think that the issue is related to the react-native-event-source implementation, please let me know if you've experienced the same thing? Or if I should search for a problem elsewhere in my application / server implementation?
Edit: Expo SDK v35 (also reproducible on v36), React Native v0.59 (also reproducible on v0.61). Issue arises on iOS and Android both.
The text was updated successfully, but these errors were encountered:
btw, if anyone cares: my workaround is to store the id of each message received... and when a new message kicks in - I double-check first if it is unique or not. Not ideal, I know, but it works.
I’ll be honest I haven’t personally used this library in a while but I do know when I was using it I didn’t have this problem. It would help to know the version of react native your using, what OS (iOS or Android) and if you can reproduce the repeating problem with another server instance.
If you can also provide a working example that I can run that would help resolve the problem as well.
On Feb 6, 2020, at 5:41 AM, Kaloyan Kosev ***@***.***> wrote:
btw, if anyone cares: my workaround is to store the id of each message received... and when a new message kicks in - I double-check first if it is unique or not. Not ideal, I know, but it works.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
@jordanbyron thanks for your input! I edited the issue with version details. Expo SDK v35 (also reproducible on v36), React Native v0.59 (also reproducible on v0.61). Issue arises on iOS and Android both. I'll see if I can reproduce it on another server instance.
First of all, thanks @jordanbyron for the great work you've done! 👏
I noticed a strange issue on my end. Long story short - the same
MessageEvent
is getting dispatched via the EventSource over and over again, even though the back-end is not emitting a new message.Here's the
MessageEvent
which gets dispatched:I'm sure that my back-end is not emitting a new message because I also have a web interface where I can test, wired up with the EventSource Web API, where the issue doesn't occur. Moreover the
creationDate
timestamp in theMessageEvents
data I'm receiving from my server and all the other params are absolutely the same.On my end, this is causing performance issues, because it triggers my
sseSource.addEventListener
logic I have over and over again every minute or so (there is around 1 min delay until all of the same events get dispatched again, so strange?).My implementation is quite straight-forward, nothing special I think:
I tend to think that the issue is related to the
react-native-event-source
implementation, please let me know if you've experienced the same thing? Or if I should search for a problem elsewhere in my application / server implementation?Edit: Expo SDK v35 (also reproducible on v36), React Native v0.59 (also reproducible on v0.61). Issue arises on iOS and Android both.
The text was updated successfully, but these errors were encountered: