Send swallowed auth/migration DB errors to Sentry, and stop reporting routine 4xx
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
- Lĩnh vực
- backend, observability-sre
Hướng nghiên cứu
Bắt đầu với hook onError trong platform/src/server.ts:30-32, sau đó kiểm tra các lỗi bị nuốt trong server.ts:48 và instance-auth.ts:139 và :275. Đọc các chỗ sử dụng captureException hiện có trong instance-auth.ts và phần triển khai trong platform/src/util/sentry.ts. Hoàn tất có nghĩa là cả ba lỗi DB đều được ghi nhận, các lỗi 4xx thông thường được bỏ qua, còn các log và phản hồi HTTP hiện có vẫn không thay đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Jupyter Notebook
- Star
- 5
- Fork
- 10
- Merge trung bình
- 2 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 16
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của OpenFn/apollo
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
platform
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
OpenFn/apollo#699 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của OpenFn/apollo
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
jessepollak/home#1627 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement status: needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
mastra-ai/mastra#25508 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
canonical/testflinger#1346 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
onedrive: ChangeNotify drops the delta token after one failed poll and stops notifying until remountĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 3 ngày