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

Send swallowed auth/migration DB errors to Sentry, and stop reporting routine 4xx

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

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

説明

bug monitoring platform

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:48 calls captureException, with the import added to server.ts.
  • Startup DB-probe failure at platform/src/auth/instance-auth.ts:139 calls captureException.
  • Runtime client-lookup failure at platform/src/auth/instance-auth.ts:275 calls captureException.
  • The onError hook (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 — onError still 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

環境構築

はじめの一歩

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

OpenFn/apollo のほかの issue

OpenFn/apollo の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

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

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