nextcloud / nextcloud/notifications

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

Open
#3,115 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
JavaScript
Stars
153
Forks
67
Avg merge
15h 3m
Merged PRs (30d)
96

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/NotificationsApp.vue, especially the webNotificationsGranted state and checkWebNotificationPermission() around lines 539-566. Reproduce the behavior in Safari and inspect how window.Notification.permission is handled across tabs. Done means the red dot is absent when there are no notifications and web push permission has been denied, with the relevant notification behavior still logged correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.