htmx requests that error fail silently

オープン
#381 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
57/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript, ruby
領域
frontend

調査の方向性

Start by locating the application and backend entrypoints and how their JavaScript is loaded. Check how the 500 page exposes data-error-id and how existing toast notifications are implemented. Done means htmx response and network errors show the specified messages, with the Sentry event id copyable when present.

索引モデルが issue の本文から書いたものです。

説明

Errors now render real 500/404 pages instead of redirecting home with a flash. htmx doesn't swap non-2xx responses by default, so when an `hx-*` request errors, nothing visible happens. (Before, htmx followed the redirect and swapped the home page into the target, which was also wrong.)

Proposal: a small global handler loaded in both the `application` and `backend` entrypoints:

  • on `htmx:responseError`, show a dismissable toast with a message for the status:
    • 404: "couldn't find that"
    • 403: "you don't have permission"
    • 422: "refresh and try again"
    • otherwise: "something went wrong"
  • when the 500 page includes a Sentry event id (`data-error-id`), show that id with click-to-copy.
  • on `htmx:sendError` (network failure), show a "couldn't reach the server" toast.
主要言語
Ruby
スター
85
フォーク
72
平均マージ
3日 12時間
マージ済み PR(30日)
22

環境構築

はじめの一歩

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

hackclub/auth のほかの issue

hackclub/auth の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

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

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