-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Allow users to force notifications to be marked as read #2248
Allow users to force notifications to be marked as read #2248
Conversation
Passing run #2819 ↗︎Details:
Review all test suite changes for PR #2248 ↗︎ |
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.
Question: I don't see how this PR will help sync the existing status of the notification back to the client. This seems to be modifying the action of marking all notifications as read, but where is the code for grabbing the latest value of a notification's read status? Is that what should be fixed?
Actually, the syncing notifications status is already implemented. I guess the reason of the difference status between two devices is because that there could be a network issue in one device. So it could fail to listen the KV event and to update notification status on this device. So what I did in this PR is to allow users to force updating the notifications read status. When the user clicks Actually, there could be two choices. I thought the first one is better in terms of performance, so I worked on it. @taoeffect, do you think there is a real bug in listening KV event? If not, which option do you prefer? |
I don't see how that would help, because this is already called on login by |
That makes sense.
As I have already said in here, I couldn't have any chance to encounter this issue on my side. I tried many times, but never encountered. So, it is difficult to investigate. |
Here's something you can try:
Then do that again if the problem doesn't reproduce, but switch device 1 and device 2 (e.g. if device 1 was desktop, make it phone). |
@taoeffect, with your recommended workflow, I can see the the second device doesn't get updated with the notifications status even though refresh the browser. After some investigation, I have noticed that we should call |
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.
Great work @Silver-IT !!!
Minor request for error handling please:
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.
Actually, one more change request: we want to call sbp('gi.actions/identity/kv/load')
when we come back online, so could you please do the following:
- Add an event to
events.js
calledONLINE
- emit this event in
main.js
in theonline
handler EDIT: and the'reconnection-succeeded'
handler too - listen for this event in
identity-kv.js
and callsbp('gi.actions/identity/kv/load')
in the event listener (please copy the same.catch
handler, but modify the error message to make it clear that the error happened in the online handler, instead of during login)
When I run So this PR seems to result in two common heisenbugs:
|
….js + improvements + Reverted changes to group-chat.spec.js because they weren't fixing anything and the tests are passing locally on my machine + Updated group-proposals.spec.js to fix a weird possible Heisenbug by enabling a bypassUI (because that test was failing on my machine) + Updated main.js to emit ONLINE for online event handler as well + added related console.info logging
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.
Great work @Silver-IT ! (And @taoeffect). To deal with the heisenbug I've commented out the problematic line for now and updated issue #2256.
Summary of Changes