fix(jobs): keep a connection syncing when one of its accounts cannot be read
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
調査の方向性
Read src/lib/jobs/sync-connection.ts and its account loop, then trace the reconnect flow in src/lib/connections/connect.ts and the adapter errors named in the issue. The work spans account level persistence, several adapters, GitHub installation checks, the connection page, and unit and Playwright tests. Done means the listed acceptance criteria pass, including the specified typecheck, lint, database tests, and connections end to end spec.
索引モデルが issue の本文から書いたものです。
説明
Context
Do after #760: it changes the same loop in src/lib/jobs/sync-connection.ts.
Found by the Fable pre-production review on 2026-12-02 (main at cedc1914; every line reference below re-checked on main at cde5aa3b). Source: provider connect readiness report, N5.
One account that cannot be read stops every account on its connection:
- The account loop has no per-account handling (
src/lib/jobs/sync-connection.ts:206-288): any throw goes tohandleFailurefor the whole connection (:113-114). - A 404 is
invalid_response(src/lib/adapters/errors.ts:164), which a deleted Supabase project hits on its first request (src/lib/adapters/supabase/index.ts:826-834). - An account the credential no longer covers throws a plain
Error(src/lib/adapters/vercel/index.ts:1025,src/lib/adapters/stripe/index.ts:1096,src/lib/adapters/digitalocean/index.ts:1329), which counts asinternal_error(sync-connection.ts:386) and is retried every hour. - A reconnect upserts the accounts the new grant lists and never retires the rest (
src/lib/connections/connect.ts:184-196), so an account the grant dropped stays included. - GitHub's sync never checks that the account belongs to the installation it mints a token for (
src/lib/adapters/github/index.ts:475-495), so after a reconnect that grants another installation, the new account's figures can be stored under the old account.
Impact: one deleted Supabase project, an unshared Railway workspace, or a reconnect that grants another team stops the whole connection, with "did not answer" copy that points at the provider (sync-connection.ts:357). Every other account on it goes stale. #529 covers the simulated case only.
Plan
- Catch an account's failure inside the loop: record it on that account (a new
external_accountscolumn for the last error code and reference), log it with a reference, and continue with the next account. - Fail the connection only when every account failed, or when the error is connection wide (
auth_revoked,permission_missing, rate limit). - On reconnect, mark an included account the new grant no longer lists as not covered (skip it in sync, show it on the page) instead of leaving it included.
- Replace the plain
Errors for an uncovered account with a typed adapter error, so it is classified as "account not covered", notinternal_error. - GitHub: refuse an
externalAccountIdthat is not the installation's account before minting a token. - The connection page names a failing or uncovered account and what to do.
Acceptance criteria
- A failing account is named on the connection page with a reference, and the other accounts still sync (unit test).
- After a reconnect, an included account the grant no longer lists is skipped and marked on the page (unit test).
- GitHub refuses an account id that is not its installation's (unit test).
- The Vercel, Stripe, and DigitalOcean "not covered" errors are typed and not retried as
internal_error. - Playwright e2e covers the connection page notice, with an axe scan and a keyboard pass.
Files and areas
src/lib/jobs/sync-connection.ts, src/lib/connections/connect.ts, src/lib/adapters/errors.ts, the three adapters named above, src/lib/adapters/github/index.ts, a migration for the account level error, src/app/w/[workspace]/connections/[connectionId]/page.tsx, their tests.
Non-goals: the sync deadline (#{n4}), the connection level failure copy (separate issue), simulated reconnects (#529).
Verification
npm run typecheck, npm run lint, npx vitest run src/lib/jobs src/lib/connections src/lib/adapters, npm run test:db, the connections e2e spec.
Branch: <issue-number>-account-failure-isolation
Model: anthropic/claude-opus-5-5 | Reasoning effort: unknown
- 主要言語
- TypeScript
- スター
- 13
- フォーク
- 2
- 平均マージ
- 5時間 20分
- マージ済み PR(30日)
- 287
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
eddiejaoude/StackDash のほかの issue
-
area: integrations documentation priority: P2 size: XS
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
eddiejaoude/StackDash#798 ·
メンテナーはふだん 1 日以内に返信
-
area: ops documentation priority: P3 size: XS
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
eddiejaoude/StackDash#796 ·
メンテナーはふだん 1 日以内に返信
-
area: docs documentation impact: low priority: P3 size: XS
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
eddiejaoude/StackDash#790 ·
メンテナーはふだん 1 日以内に返信
-
area: ops bug impact: low priority: P3 size: XS
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
eddiejaoude/StackDash#785 ·
メンテナーはふだん 1 日以内に返信
-
area: connections enhancement impact: low priority: P3 size: XS
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
eddiejaoude/StackDash#768 ·
メンテナーはふだん 1 日以内に返信
eddiejaoude/StackDash の issue をすべて見る
似ている issue
-
bot:ai-assisted component:midnight-js status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
midnightntwrk/midnight-js#1790 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
area:vscode bug has repro platform:macos platform:vscode regression
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDオープンcheck:passed streams:add
難易度 1/5 1時間未満 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
effort/l priority/p1 risk/high triage/core
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
iflytek/skillhub#1188 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信