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

Fix SSE timeout bug #19

Merged
merged 3 commits into from
Oct 2, 2024
Merged

Fix SSE timeout bug #19

merged 3 commits into from
Oct 2, 2024

Conversation

AlexanderKolberg
Copy link
Contributor

@AlexanderKolberg AlexanderKolberg commented Sep 26, 2024

If the stream gets dropped without being properly closed, the client needs to end the stream. The current implementation errors out with an global error instead of triggering the onError hook.
This is caused by an incorrect throwing of an error inside of a setIntervall (see "the this problem" on MDN)

This resolves the problem, by setting an error flag that triggers the timeout error. Instead of throwing directly from the setIntervall

Copy link
Contributor

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Let's look into this syntax proposal too:
webrpc/webrpc#311

@VojtechVitek VojtechVitek merged commit ca8157b into master Oct 2, 2024
2 checks passed
@VojtechVitek VojtechVitek deleted the sse-timeout-bug branch October 2, 2024 13:18
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.

3 participants