Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#1,068 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 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 の本文から書いたものです。

説明

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
スター
16k
フォーク
891
平均マージ
2日 11時間
マージ済み PR(30日)
6

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

gotify/server のほかの issue

gotify/server の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。