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

WebUI sends duplicate DELETE /message/{id} when leaving the page with pending deletes

Aperta Adatta ai principianti
#1,068 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
80/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, typescript
Ambito
frontend

Direzione di ricerca

Inizia da reactions.ts, dove executePendingDeletes è registrata sia per pagehide sia per beforeunload, poi leggi MessagesStore.removeSingle, che controlla pendingDeletes ma svuota la voce solo dopo che la DELETE di axios restituisce una risposta. Riproduci il problema eliminando dei messaggi nell'interfaccia web, chiudendo la scheda mentre la snackbar di annullamento è aperta e osservando il registro di rete alla ricerca di richieste DELETE duplicate. Il lavoro è completo quando ogni messaggio riceve esattamente una richiesta DELETE quando la pagina viene abbandonata.

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

Descrizione

a:bug

I stumbled across some 404 in the docker logs and asked my artifical friend to dig deeper into this. He drills it down to some js code in the web frontend. If that is okay with you maybe you'll take a look at it - thanks 😅

Can the issue be reproduced with the latest available release? (y/n)
y (v3.1.1)

Which one is the environment gotify server is running in?

  • Docker
  • Linux machine
  • Windows machine
Docker startup command or config file here (please mask sensitive information)
image: gotify/server:latest  # 3.1.1, commit e6361ca

Do you have an reverse proxy installed in front of gotify server? (Please select None if the problem can be reproduced without the presense of a reverse proxy)

  • None
  • Nginx
  • Apache
  • Caddy
  • Traefik (not relevant, the duplicate requests originate in the WebUI)

On which client do you experience problems? (Select as many as you can see)

  • WebUI
  • gotify-cli
  • Android Client
  • 3rd-party API call

What did you do?
Deleted messages in the WebUI and left/closed the tab while the undo snackbar was still open.

What did you expect to see?
One DELETE /message/{id} per message.

What did you see instead?
Two DELETE /message/{id} per message in the same second; the second one usually fails:

INF HTTP method=DELETE path=/message/150242 status=200
WRN HTTP errors="Error #01: message does not exist" method=DELETE path=/message/150242 status=404

Cause: reactions.ts registers executePendingDeletes for both pagehide and beforeunload, which usually both fire when leaving the page. MessagesStore.removeSingle checks pendingDeletes.has(id) but only removes the entry (cancelPendingDelete) after await axios.delete(...) returns, so the second call passes the check and sends another DELETE.

Possible fix: remove the entry from pendingDeletes before sending the request (or guard executePendingDeletes so it runs only once).

Lingua principale
Go
Stelle
16k
Fork
891
Merge medio
2g 11h
PR unite (30g)
6

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 gotify/server

Tutte le issue di gotify/server

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.