Opened on 08/12/2017 at 04:34:04 PM
Closed on 08/29/2019 at 05:43:18 PM
Last modified on 10/08/2019 at 05:54:40 PM
#5512 closed change (rejected)
Add support for multiple notifications in lib/notificationHelper.js
Reported by: | mjethani | Assignee: | mjethani |
---|---|---|---|
Priority: | P2 | Milestone: | |
Module: | Platform | Keywords: | closed-in-favor-of-gitlab |
Cc: | sebastian, kzar, greiner | Blocked By: | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by mjethani)
Background
Multiple notifications can be displayed at the same time, whereas lib/notificationHelper.js only supports a single notification at a time. If multiple notifications are displayed anyway, it fails badly.
Some things that are obviously broken:
- activeButtons is updated in showNotification. If later the user clicks on one of the buttons in an older notification widget that is still being displayed, it would either do nothing or, worse, call the wrong handler.
- Closing an older notification will clear out the currently active notification.
- If the notification is of type question but chrome.notifications is not supported, it will use the confirm API instead, which is synchronous, but display the icon animation and set it to the active notification afterwards after the notification has already been dismissed. Happily this is not a problem in practice as questions do not appear in the popup, but it is still an error in the logic and may manifest as a bug in the future. Moreover, before this even happens, there's an error because activeNotification.onClicked is not yet defined.
- If the user closes an open notification using the platform's native UI, it will clear out the active notification but not stop the icon animation.
There may be more.
Also, critical notifications should remain visible until the user dismisses them, but this is not the case (tested on Chrome 59 on macOS 10.12.5).
What to change
Distinguish between the "active" notification and "open" notifications as they are two different concepts, and modify the code accordingly by using the appropriate data structures to manage multiple notifications. Fix any bugs.
Pass the requireInteraction option to notifications.create, with a value of true for critical notifications and false otherwise.
Attachments (0)
Change History (10)
comment:1 Changed on 08/12/2017 at 04:36:23 PM by mjethani
comment:4 Changed on 08/21/2017 at 01:14:07 PM by kzar
- Cc greiner added
- Priority changed from Unknown to P2
- Ready set
(Adding Thomas to Cc since this relates to the UI.)
comment:6 Changed on 01/03/2019 at 04:37:39 AM by johnson83
spam
comment:7 Changed on 06/17/2019 at 03:25:28 PM by slotslotonline
spam
comment:8 Changed on 08/29/2019 at 05:43:18 PM by sebastian
- Keywords closed-in-favor-of-gitlab added
- Resolution set to rejected
- Status changed from new to closed
Sorry, but we switched to GitLab. If this issue is still relevant, please file it again in the new issue tracker.
comment:9 Changed on 09/04/2019 at 03:49:18 PM by slotslotonline
spam
comment:10 Changed on 09/04/2019 at 03:50:14 PM by slotslotonline
spam
This work is required to get the extension working decently on Firefox for Android (WebExtensions).