Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open Beginner friendly
#1,068 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
80/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Domain
frontend

Research direction

Start in reactions.ts, where executePendingDeletes is registered for both pagehide and beforeunload, then read MessagesStore.removeSingle, which checks pendingDeletes but only clears the entry after the axios DELETE returns. Reproduce by deleting messages in the web UI, closing the tab while the undo snackbar is open, and watching the network log for duplicate DELETE requests. Done when each message gets exactly one DELETE request when the page is left.

Written by the indexing model from the issue text.

Description

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).

Dominant language
Go
Stars
16k
Forks
891
Avg merge
2d 11h
Merged PRs (30d)
6

Getting set up

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.

More from gotify/server

All issues in gotify/server

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.