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

Messages counters display incorrect number of messages; alerts not consistently dismissed #1497

Closed
jwzimmer-zz opened this issue Sep 1, 2017 · 11 comments
Assignees
Labels
Milestone

Comments

@jwzimmer-zz
Copy link
Contributor

jwzimmer-zz commented Sep 1, 2017

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.

screen shot 2017-09-01 at 1 10 37 pm

screen shot 2017-09-01 at 1 10 31 pm

screen shot 2017-09-01 at 1 01 19 pm

screen shot 2017-09-01 at 1 01 12 pm

out3

@mewtaylor
Copy link
Contributor

@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.

@thisandagain thisandagain added this to the Aug 23 milestone Sep 3, 2017
@thisandagain
Copy link
Contributor

/cc @rschamp

@mewtaylor
Copy link
Contributor

@mewtaylor
Copy link
Contributor

@chrisgarrity
Copy link
Contributor

The first time I went to the messages page the number was wrong (7 not 3):
screen shot 2017-09-05 at 4 34 16 pm

But the next time it was correct:
screen shot 2017-09-05 at 4 38 58 pm

By the way it is a student account.

@jwzimmer-zz jwzimmer-zz reopened this Sep 5, 2017
@jwzimmer-zz
Copy link
Contributor Author

jwzimmer-zz commented Sep 6, 2017

Currently I am seeing this with the account abcdekfy on Staging (Safari, Mac OS El Capitan).

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).

screen shot 2017-09-06 at 2 00 23 pm

screen shot 2017-09-06 at 2 00 06 pm

@mewtaylor
Copy link
Contributor

@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

@jwzimmer-zz
Copy link
Contributor Author

The invite to become a Scratcher doesn't seem to be incrementing the messages counter in the navbar:

screen shot 2017-09-07 at 2 56 38 pm

@jwzimmer-zz
Copy link
Contributor Author

jwzimmer-zz commented Sep 7, 2017

Scratchr2 navbar said 0, but scratch-www navbar says 2 (for arglebargle):
screen shot 2017-09-07 at 4 40 55 pm
screen shot 2017-09-07 at 4 40 50 pm
screen shot 2017-09-07 at 4 40 33 pm

Update

This difference went away when I cleared the cache. : )

@jwzimmer-zz
Copy link
Contributor Author

jwzimmer-zz commented Sep 8, 2017

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.
@mewtaylor explained that:

the way that works is that something appearing as “unread” is not a demarcation on the notification itself – there’s a count that’s cached, and it just shows the first n messages as “unread” depending on the count
so, it’s not that that message is “unread” – it’s that the count seems to have gotten off somehow

After investigation it turned out that the issue was what happened when a project was added to the studio.
@mewtaylor said:

I think I see the issue. I had a place where I increment the cache count that I forgot to remove yesterday when I was making changes
so it incremented the cache count without there being something to display
because I originally thought adding a project to a studio resulted in a notification

But all the studio activities are consolidated into one notification per day.

@mewtaylor is fixing this issue now! : )

screen shot 2017-09-08 at 4 25 46 pm

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?

screen shot 2017-09-08 at 4 51 53 pm

@mewtaylor said:

With the change I made yesterday that excluded showing activity where you’re both the actor and recipient, I think I just forgot to make an update for posting in a forum you follow. I’ll make that update now, and check if there are any other cases like that that could come up.

@jwzimmer-zz
Copy link
Contributor Author

Should be fixed by @mewtaylor's latest changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants