-
Notifications
You must be signed in to change notification settings - Fork 840
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
Messages counters display incorrect number of messages; alerts not consistently dismissed #1497
Comments
@jwzimmer this is due to the behavior of navigating away from the messages page, and immediately back to it within the span of 2 minutes – these api endpoints are all cached for 2 minutes. If you were to come back after 2 minutes, it would display correctly. These messages are indeed dismissed, but the list of messages will not get updated until after the cache expires. I don't think it's a good idea to purge these endpoints after a dismissal and optimize for immediate revisits, because this is a behavior that is more often seen in testing than in production. Consequently, I think we should not worry about the message re-appearing in this type of interaction. I can look into the negative counter though, that seems like an actual bug. |
/cc @rschamp |
tracking in https://github.com/LLK/scratch-api/pull/325 |
Currently I am seeing this with the account The navbar counter says 6 on both www and r2 pages; the Messages from Scratch Team counter says 7 (and there are 7 alerts) and the Messages counter does not say anything (0). @mewtaylor looked at this account and fixed this issue in https://github.com/LLK/scratchr2/commit/e3da4b1a589271a05a723a093555b8e4c3b2a9de. However, this is not a repro of the issue @chrisgarrity observed in #1497 (comment). |
@jwzimmer that most recent version of this issue should be solved in https://github.com/LLK/scratchr2/commit/e3da4b1a589271a05a723a093555b8e4c3b2a9de. As for the student account issue that was being seen by @chrisgarrity, I still have not repro'd yet |
Sort-of-repro I saw 5 notifications marked as unread and 5 in the navbar counter, but the last notification was from 20 hours ago and had definitely been read multiple times today.
After investigation it turned out that the issue was what happened when a project was added to the studio.
But all the studio activities are consolidated into one notification per day. @mewtaylor is fixing this issue now! : ) The plot thickens I replied to a thread I follow, and expected to see that notification, but instead saw the same old message re-marked as read - like the counter is increasing correctly, but the most recent notification isn't showing up? @mewtaylor said:
|
Should be fixed by @mewtaylor's latest changes. |
TL;DR: There are a couple things going on here contributing to the effect of the counters being unreliable & the alert dismissal being unreliable: (1) Dismissing an alert doesn't always permanently dismiss it; (2) The Messages value should never be less than 0, but somehow it currently can be; (3) The counter in the navbar is wrong if either counter from the body of the Messages page is wrong.
Chrome 60, Mac OS El Capitan, Staging
Dismissing an alert always reduces the value of the "Messages from the Scratch Team" counter while you are on the Messages page, but once you navigate away and back again, the counter may not stay decremented.
Repro
If you click an X to dismiss an alert, then go to the Explore page, then go back to the Messages page, the alert you just dismissed will have come back.
The "Messages" counter on the body of the Messages page should never have a value less than 0, but currently it's displaying a value of -2. (I'm not sure exactly what causes this.)
The navbar message counter seems to be set based on the "Messages" counter + "Messages from the Scratch Team" counter, so if one of those values is incorrect, the value in the navbar message counter is also incorrect.
The text was updated successfully, but these errors were encountered: