Red dot always shown in Safari even though there are no notifications and web push permissions have already been denied
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- javascript
- Ambito
- frontend
Direzione di ricerca
Inizia in src/NotificationsApp.vue, in particolare con lo stato webNotificationsGranted e checkWebNotificationPermission() intorno alle righe 539-566. Riproduci il comportamento in Safari e verifica come viene gestito window.Notification.permission tra le schede. Il lavoro è completato quando il punto rosso è assente se non ci sono notifiche e l’autorizzazione per le notifiche web push è stata negata, mentre il comportamento rilevante delle notifiche continua a essere registrato correttamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Steps to reproduce
- Open Nextcloud on Safari
- Click bell icon with red dot
- If asked, deny web push permissions
- Open Nextcloud in new tab
- Notice red dot on bell icon
- Click bell icon
- There are no notifications
Expected behaviour
If there are no notifications and web push permissions have been denied, a red dot should not be displayed
Actual behaviour
Red dot it displayed even tough web push permissions have been denied and there are no notifications
Server configuration
Web server: Nginx
Database: MySQL
PHP version: 8.5
Nextcloud version: 33.0.5
List of activated apps
not relevant
Nextcloud configuration
also not relevant
Browser
Browser name: Safari
Browser version: 26.5 (21624.2.5.11.4)
Operating system: macOS Tahoe 26.5
Browser log:
[Info] Notifications permissions not yet requested (NotificationsApp-iD1fLC7v.chunk.mjs, line 86)
[Debug] Has notify_push enabled, slowing polling to 15 minutes (NotificationsApp-iD1fLC7v.chunk.mjs, line 86)
[Debug] Polling interval updated to 900000 (NotificationsApp-iD1fLC7v.chunk.mjs, line 86)
[Debug] Started background fetcher as session_keepalive is enabled (NotificationsApp-iD1fLC7v.chunk.mjs, line 86)
[Debug] Got notification data, restoring default polling interval. (NotificationsApp-iD1fLC7v.chunk.mjs, line 86)
Additional Info:
I believe the dot is shown because of webNotificationsGranted === null, see https://github.com/nextcloud/notifications/blob/9ca979d446e21dc9024291d132a4b6cf2289788c/src/NotificationsApp.vue#L18
This is because none of the scenarios covered by the if-tree in checkWebNotificationPermission() match, so null is returned (which is also why Notifications permissions not yet requested)
https://github.com/nextcloud/notifications/blob/9ca979d446e21dc9024291d132a4b6cf2289788c/src/NotificationsApp.vue#L539-L566
Curiously, from the browser console, window.Notification.permission returns default, even though Nextcloud had previously already requested web push permissions and I had not granted them. This is also reflected in Safari's settings:
When removing the entry within Safari's settings and reloading the window, I get asked for notification permissions again. If I click deny and refresh again, everything is working fine and there is no red dot:
[Debug] Notifications permissions denied (NotificationsApp-iD1fLC7v.chunk.mjs, line 86)
[Debug] Has notify_push enabled, slowing polling to 15 minutes (NotificationsApp-iD1fLC7v.chunk.mjs, line 86)
[Debug] Polling interval updated to 900000 (NotificationsApp-iD1fLC7v.chunk.mjs, line 86)
[Debug] Started background fetcher as session_keepalive is enabled (NotificationsApp-iD1fLC7v.chunk.mjs, line 86)
[Debug] Got notification data, restoring default polling interval. (NotificationsApp-iD1fLC7v.chunk.mjs, line 86)
This time, window.Notification.permission correctly returns deny.
However, after opening Nextcloud in a new tab, the red dot appears again, the log again shows Notifications permissions not yet requested and window.Notification.permission returns default again.
It seems like window.Notification.permission is not reliable on Safari, leading to the red dot appearing when it shouldn't. A quick google search led me to a Reddit thread, where in the comments someone mentioned using pushManager instead, so maybe that is the solution? This is probably also what https://github.com/nextcloud/notifications/issues/2969 is about?
Thanks for looking into this!
- Lingua principale
- JavaScript
- Stelle
- 154
- Fork
- 67
- Merge medio
- 19h 23m
- PR unite (30g)
- 90
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nextcloud/notifications
-
1. to develop bug feature: frontend 🖌️
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
nextcloud/notifications#2969 ·
I maintainer di solito rispondono entro 1 giorno
-
0. Needs triage bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
nextcloud/notifications#3411 ·
I maintainer di solito rispondono entro 1 giorno
-
1. to develop bug feature: push 📲 performance regression
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
nextcloud/notifications#3318 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Webpush is not performingAperta1. to develop feature: backend 🛠️ feature: push 📲 performance regression
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
nextcloud/notifications#3217 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
nextcloud/notifications#2695 · 8 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di nextcloud/notifications
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
openlibhums/janeway#5604 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Generic OSC does not initialize OSC client on startup when "Listen for Feedback" is disabledAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
-
area/statement-execution TS conversion
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
scylladb/nodejs-rs-driver#584 ·
I maintainer di solito rispondono entro 2 giorni
-
新讀者走讀回報,照著一篇文章實際操作Apertadocumentation good first issue help wanted
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
I maintainer di solito rispondono entro 3 giorni