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 UI でメッセージを削除し、元に戻すスナックバーが開いている間にタブを閉じ、ネットワークログで重複した DELETE リクエストがないか確認するというものです。ページを離れたときに、各メッセージに対して DELETE リクエストがちょうど 1 回だけ送られれば完了です。
索引モデルが 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
- スター
- 16k
- フォーク
- 891
- 平均マージ
- 2日 11時間
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
gotify/server のほかの issue
-
Session elevation duration is unbounded, and large values silently overflow to a past timestamp対応中かも @piyush295 が 14 日前に担当しました。 オープンa:bug
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
gotify/server#1051 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
a:bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
gotify/server#1047 · コメント 6 件 ·
メンテナーはふだん 2 日以内に返信
-
a:feature
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 2 日以内に返信
-
a:feature
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 2 日以内に返信
-
a:feature
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
small item
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
canonical/pebble#1127 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 89/100
open-policy-agent/opa#9366 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
defect
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nats-io/nats-server#8752 ·
メンテナーはふだん 1 日以内に返信
-
enhancement needs-acceptance wg/router-models-inference-runtime
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
vllm-project/semantic-router#5015 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
fileserver: precompressed sidecar's Content-Encoding and Content-Length end up on error responses対応中かも @NitinKumar004 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
caddyserver/caddy#8204 ·
メンテナーはふだん 1 日以内に返信