WebUI sends duplicate DELETE /message/{id} when leaving the page with pending deletes
维护者通常 2 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 80/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, typescript
- 领域
- frontend
调研方向
从 reactions.ts 开始,其中 executePendingDeletes 同时注册在 pagehide 和 beforeunload 上,然后阅读 MessagesStore.removeSingle。该函数会检查 pendingDeletes,但只有在 axios DELETE 返回之后才清除对应条目。复现方法:在 Web 界面中删除消息,在撤销提示条仍打开时关闭标签页,并在网络日志中查看是否有重复的 DELETE 请求。完成标准是离开页面时,每条消息恰好收到一个 DELETE 请求。
由索引模型根据 Issue 内容生成。
描述
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 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
gotify/server 的其他 Issue
-
a:bug
难度 2/5 1-3 小时 新手友好度 35/100
维护者通常 2 天内回复
-
Session elevation duration is unbounded, and large values silently overflow to a past timestamp可能已有人在做 @piyush295 于 23 天前认领。 未关闭a:bug
难度 3/5 1-2 天 新手友好度 78/100
维护者通常 2 天内回复
-
a:bug
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 2 天内回复
-
a:feature
难度 5/5 一周以上 新手友好度 35/100
维护者通常 2 天内回复
-
a:feature
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 2 天内回复
相似的 Issue
-
usage: a custom provider's balance meters ("…%" in the balance path) ignore the Left/Used switch未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug iam-service
难度 2/5 1-3 小时 新手友好度 76/100
platform-mesh/platform-mesh#425 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
grafana/tempo-operator#1691 ·
维护者通常 1 天内回复
-
fix: presentation.go with mcp-table.go: the message for each MCP server comes back可能已有人在做 @mge1512 今天认领。 未关闭bug
难度 1/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
slavakurilyak/awesome-ai-agents#827 ·
维护者通常 1 天内回复