Send swallowed auth/migration DB errors to Sentry, and stop reporting routine 4xx
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
- #684 @AchrafReyani による — マージされずにクローズ
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- typescript
調査の方向性
platform/src/server.ts:30-32 の onError フックから始め、次に server.ts:48 と instance-auth.ts:139 および :275 で握りつぶされている失敗を調べます。instance-auth.ts にある既存の captureException の使用箇所と、platform/src/util/sentry.ts の実装を読みます。完了条件は、3 つすべての DB エラーが捕捉され、通常の 4xx エラーがスキップされ、既存のログと HTTP レスポンスが変更されないことです。
索引モデルが issue の本文から書いたものです。
説明
Two related problems with how we report errors to Sentry.
First, three database failures in the client-auth path get logged with console.error and then forgotten. They never reach Sentry, so we're blind to them in production.
Second, the Elysia onError hook sends every error to Sentry, including routine 4xx like favicon bots hitting NOT_FOUND. That noise buries the errors we actually care about.
They sit in overlapping code, so it's easier to fix them together.
1. Capture the three swallowed DB errors. Each one currently console.errors and moves on:
platform/src/server.ts:48— migration run failure (runMigrations()).platform/src/auth/instance-auth.ts:139— startup DB-probe (reachability) failure; auth degrades to the shape-checked forward path.platform/src/auth/instance-auth.ts:275— runtime client-lookup failure; request fails closed.
Each of these needs an explicit captureException(err, …) next to the log it already writes. captureException is already imported in instance-auth.ts:7 and used elsewhere in that file (lines 158, 251, 312), so those two sites are just inconsistent with the rest of it. server.ts needs the import adding (import { captureException } from "./util/sentry").
2. Skip 4xx in the onError hook. Request errors only reach Sentry through the onError hook at platform/src/server.ts:30-32, and it calls captureException(error) for everything. Add a status check so we only capture 5xx and unexpected errors, and skip the routine 4xx like NOT_FOUND. Elysia hands us the error code and status on the onError context, so the guard lives right there in the hook.
Sentry is wired in platform/src/util/sentry.ts (captureException is a no-op when SENTRY_DSN is unset) and initialised from platform/src/index.ts:4.
Acceptance criteria
- Migration failure at
platform/src/server.ts:48callscaptureException, with the import added toserver.ts. - Startup DB-probe failure at
platform/src/auth/instance-auth.ts:139callscaptureException. - Runtime client-lookup failure at
platform/src/auth/instance-auth.ts:275callscaptureException. - The
onErrorhook (platform/src/server.ts:30-32) only captures 5xx/unexpected errors; 4xx (e.g.NOT_FOUND) is skipped. - No behaviour change to the HTTP responses themselves —
onErrorstill returns nothing so Elysia produces its normal error body/status. - Existing log lines retained; Sentry capture is additive.
- 主要言語
- Jupyter Notebook
- スター
- 5
- フォーク
- 9
- 平均マージ
- 3日 12時間
- マージ済み PR(30日)
- 15
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OpenFn/apollo のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
platform
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 8 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
its-me-prash/vwgroup-connect-ha#1858 ·
メンテナーはふだん 1 日以内に返信
-
Deleting all alarms or timers shows deleted ones until the next update when there are none leftオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
leikoilja/ha-google-home#1107 ·
メンテナーはふだん 1 日以内に返信
-
🐛 bug 🗺️ DB Models & Ops
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
LibreChat-AI/LibreChat#17214 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信