NodeBB / NodeBB/nodebb-plugin-web-push
Push notifications not working
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 7
- Avg merge
- 13h 31m
- Merged PRs (30d)
- 7
Description
I can't get push notifications to work.
In Safari, nothing related to push notifications is working. If I toggle the "Enable push notifications on this device" switch, the "Currently notifying x device(s)" count doesn't increment, and when I refresh the page, the toggle is off again. If I click "Send Test Notification", regardless of whether "Enable push notifications on this device" is on or off, nothing happens (no "Cannot send test notification as push notifications are not enabled on this device" warning and no /api/v3/plugins/web-push/test request in the network tab of the dev tools). There's also no "ServiceWorker registration succeeded" message in the console, but there aren't any error messages either.
In Chrome, the service worker registers successfully, and I can enable push notifications, but I can't send/receive them. If I click on "Send Test Notification", I get an error message in the console: Failed to load resource: net::ERR_CONNECTION_CLOSED /api/v3/plugins/web-push/test:1. If I send myself a chat message from another account, I get an in-app notification, but no push notification and no error message.
I'm also seeing this error on the server:
2025-04-09T18:46:53.799Z [4567/124] - error: POST /api/v3/plugins/web-push/test
invalid csrf token
However, that error only appears once, and I've attempted to send several notifications, so I'm guessing it's not the root of the issue.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Safari and Chrome behavior, checking service-worker registration, the Send Test Notification action, and requests to /api/v3/plugins/web-push/test. Compare the browser console with the server's invalid CSRF token log; done means enabling notifications persists and test and chat notifications are delivered in the affected browsers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- full-stack, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100