-
-
Notifications
You must be signed in to change notification settings - Fork 665
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
Notifications can leave a ghostly heading-notification behind #5119
Comments
gnprice
added a commit
to gnprice/zulip-mobile
that referenced
this issue
Nov 10, 2021
If the user reads the last messages in several conversations at once, and those are their only active notifications -- for example, if they have a couple of recent PMs in different threads, and visit the "Private messages" view in the web app -- then it looks from the code here like we'll delete those individual conversations' notifications, but not the summary for the group, leaving behind a ghost header. I noticed this just now from reading the code. I haven't confirmed empirically that this indeed happens. If there's a subtle reason it doesn't, though, we should resolve this TODO by making that clear. [Added later: Indeed, confirmed this empirically; filed as zulip#5119.]
gnprice
added a commit
to gnprice/zulip-mobile
that referenced
this issue
Nov 10, 2021
I added this TODO comment a few commits ago, based on studying the code, and just now I confirmed that the bug happens empirically: reading several conversations at once can leave behind a ghost group. There's also a related bug when the user reads a conversation whose notification has already been dismissed: if there's just one active notification remaining, we'll end up dismissing the whole group and that notification with it. The root cause of both of these is that we're relying on an assumption that the loop looking for notifications to cancel found exactly one such notification. In fact it may have found fewer or more than that. This can cause this code to leave the summary notification in place when it should cancel it, and vice versa. To fix, while we're looping through the notifications in order to possibly cancel some, we just note whether there are also any (in the same group) that we aren't cancelling. Fixes: zulip#5119 Fixes: zulip#5120
gnprice
added a commit
to gnprice/zulip-mobile
that referenced
this issue
Nov 11, 2021
If the user reads the last messages in several conversations at once, and those are their only active notifications -- for example, if they have a couple of recent PMs in different threads, and visit the "Private messages" view in the web app -- then it looks from the code here like we'll delete those individual conversations' notifications, but not the summary for the group, leaving behind a ghost header. I noticed this just now from reading the code. I haven't confirmed empirically that this indeed happens. If there's a subtle reason it doesn't, though, we should resolve this TODO by making that clear. [Added later: Indeed, confirmed this empirically; filed as zulip#5119.]
gnprice
added a commit
to gnprice/zulip-mobile
that referenced
this issue
Nov 11, 2021
I added this TODO comment a few commits ago, based on studying the code, and just now I confirmed that the bug happens empirically: reading several conversations at once can leave behind a ghost group. There's also a related bug when the user reads a conversation whose notification has already been dismissed: if there's just one active notification remaining, we'll end up dismissing the whole group and that notification with it. The root cause of both of these is that we're relying on an assumption that the loop looking for notifications to cancel found exactly one such notification. In fact it may have found fewer or more than that. This can cause this code to leave the summary notification in place when it should cancel it, and vice versa. To fix, while we're looping through the notifications in order to possibly cancel some, we just note whether there are also any (in the same group) that we aren't cancelling. Fixes: zulip#5119 Fixes: zulip#5120
gnprice
added a commit
to gnprice/zulip-mobile
that referenced
this issue
Nov 16, 2021
If the user reads the last messages in several conversations at once, and those are their only active notifications -- for example, if they have a couple of recent PMs in different threads, and visit the "Private messages" view in the web app -- then it looks from the code here like we'll delete those individual conversations' notifications, but not the summary for the group, leaving behind a ghost header. I noticed this just now from reading the code. I haven't confirmed empirically that this indeed happens. If there's a subtle reason it doesn't, though, we should resolve this TODO by making that clear. [Added later: Indeed, confirmed this empirically; filed as zulip#5119.]
gnprice
added a commit
to gnprice/zulip-mobile
that referenced
this issue
Nov 16, 2021
I added this TODO comment a few commits ago, based on studying the code, and just now I confirmed that the bug happens empirically: reading several conversations at once can leave behind a ghost group. There's also a related bug when the user reads a conversation whose notification has already been dismissed: if there's just one active notification remaining, we'll end up dismissing the whole group and that notification with it. The root cause of both of these is that we're relying on an assumption that the loop looking for notifications to cancel found exactly one such notification. In fact it may have found fewer or more than that. This can cause this code to leave the summary notification in place when it should cancel it, and vice versa. To fix, while we're looping through the notifications in order to possibly cancel some, we just note whether there are also any (in the same group) that we aren't cancelling. Fixes: zulip#5119 Fixes: zulip#5120
gnprice
added a commit
to gnprice/zulip-mobile
that referenced
this issue
Nov 16, 2021
If the user reads the last messages in several conversations at once, and those are their only active notifications -- for example, if they have a couple of recent PMs in different threads, and visit the "Private messages" view in the web app -- then it looks from the code here like we'll delete those individual conversations' notifications, but not the summary for the group, leaving behind a ghost header. I noticed this just now from reading the code. I haven't confirmed empirically that this indeed happens. If there's a subtle reason it doesn't, though, we should resolve this TODO by making that clear. [Added later: Indeed, confirmed this empirically; filed as zulip#5119.]
chetas411
pushed a commit
to chetas411/zulip-mobile
that referenced
this issue
Nov 28, 2021
If the user reads the last messages in several conversations at once, and those are their only active notifications -- for example, if they have a couple of recent PMs in different threads, and visit the "Private messages" view in the web app -- then it looks from the code here like we'll delete those individual conversations' notifications, but not the summary for the group, leaving behind a ghost header. I noticed this just now from reading the code. I haven't confirmed empirically that this indeed happens. If there's a subtle reason it doesn't, though, we should resolve this TODO by making that clear. [Added later: Indeed, confirmed this empirically; filed as zulip#5119.]
chetas411
pushed a commit
to chetas411/zulip-mobile
that referenced
this issue
Nov 28, 2021
I added this TODO comment a few commits ago, based on studying the code, and just now I confirmed that the bug happens empirically: reading several conversations at once can leave behind a ghost group. There's also a related bug when the user reads a conversation whose notification has already been dismissed: if there's just one active notification remaining, we'll end up dismissing the whole group and that notification with it. The root cause of both of these is that we're relying on an assumption that the loop looking for notifications to cancel found exactly one such notification. In fact it may have found fewer or more than that. This can cause this code to leave the summary notification in place when it should cancel it, and vice versa. To fix, while we're looping through the notifications in order to possibly cancel some, we just note whether there are also any (in the same group) that we aren't cancelling. Fixes: zulip#5119 Fixes: zulip#5120
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is an issue that doesn't exist in any released version; it was introduced with the spiffy new form of notification in #4842, and I discovered it later yesterday while preparing some refactors to that code after merge.
The repro recipe is:
(which was for a previous bug, fixed before merge, that once it was triggered had the same symptom.)
The root of the issue is that in the new
removeNotification
we're relying on an assumption that the loop looking for notifications to cancel found exactly one such notification. If it found more than that, the code won't realize if the summary notification should also be cancelled.The text was updated successfully, but these errors were encountered: