-
Notifications
You must be signed in to change notification settings - Fork 157
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
Implement SSE notifications #9451
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please elaborate a bit how it works in detail? 🙂 I'm especially interested in the token handling, what happens during token renewal? I got a 401
error from the SEE endpoint after a short while, not sure though if that was related to token renewal.
Also it doesn't work with pnpm vite
for me because it always tries to connect to the wrong port (9201
instead of 9200
).
@JammingBen i talked to julian, he told me the connection stays open even if the token is no longer valid. Its weird that you get an 401, i will try to replicate it |
@JammingBen i don't get the 401 anymore at least with vite, also port |
1916cb8
to
9930747
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still have 2 concerns:
- What happens if a user login is actually invalid and the server correctly returns
401
? This solution will constantly try the re-establish the connection, right? Can we add some kind of retry-limit? - An established connection won't change when the user changes their language. I assume the messages from the server come based on the
Accept-Language
header? In that case we also need to re-establish the connection with the updated language.
03dab99
to
4ee4a41
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still have 2 issues:
- When changing the language, existing SSE connections don't get terminated. You can see this by changing the language multiple times and then triggering a notification -> there will be multiple notifications.
- Notifications are not being fetched when the tab is inactive, even if I switch back to the tab. I guess we need to call the regular notifications endpoint each time we open a connection. Maybe you can do this in
onOpen
?
alright good findings |
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, feels very good now! 👍
Description
We implemented basic SSE to get notifications instantly from the server without requesting all the time.
See #9434
Related Issue
Types of changes
Checklist:
Open tasks: