Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Red dot always shown in Safari even though there are no notifications and web push permissions have already been denied

Aperta
#3,115 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

0. Needs triage bug
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
  1. Open Nextcloud on Safari
  2. Click bell icon with red dot
  3. If asked, deny web push permissions
  4. Open Nextcloud in new tab
  5. Notice red dot on bell icon
  6. Click bell icon
  7. 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:
Image

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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nextcloud/notifications

Tutte le issue di nextcloud/notifications

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.