Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

已关闭 适合新手
#1,068 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

@shivampwm2020 已经在做这个了。

开始于 2026年10月14日。

  • #1075 来自 @shivampwm2020 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
80/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
领域
frontend

调研方向

从 reactions.ts 开始,其中 executePendingDeletes 同时注册在 pagehide 和 beforeunload 上,然后阅读 MessagesStore.removeSingle。该函数会检查 pendingDeletes,但只有在 axios DELETE 返回之后才清除对应条目。复现方法:在 Web 界面中删除消息,在撤销提示条仍打开时关闭标签页,并在网络日志中查看是否有重复的 DELETE 请求。完成标准是离开页面时,每条消息恰好收到一个 DELETE 请求。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
Go
星标
16.1k
派生
898
平均合并
3 天 16 小时
30 天内合并 PR
10

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

gotify/server 的其他 Issue

查看 gotify/server 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。