NodeBB / NodeBB/nodebb-plugin-web-push

Push notifications not working

Aperta
#22 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
JavaScript
Stelle
2
Fork
7
Merge medio
13h 31m
PR unite (30g)
7

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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.

Direzione di ricerca

Inizia riproducendo il comportamento in Safari e Chrome, verificando la registrazione del service worker, l'azione Send Test Notification e le richieste a /api/v3/plugins/web-push/test. Confronta la console del browser con il log del server relativo al token CSRF non valido; il lavoro è completato quando l'abilitazione delle notifiche persiste e le notifiche di test e di chat vengono recapitate nei browser interessati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
full-stack, web-dev
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.