decision(connections): sync what the grant allows when a requested scope is missing at connect
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- nextjs, playwright, react, typescript
- 領域
- api, backend, documentation, testing
調査の方向性
Start with src/lib/connections/connect.ts and compare its missing-scope handling with src/lib/jobs/sync-connection.ts:241-300; the issue recommends option A, but requires the maintainer to choose and record an option first. Then review the connection page at src/app/w/[workspace]/connections/[connectionId]/page.tsx:256-280 and docs/connect-providers.md. Done means partial grants sync available data, essential missing scopes lead to needs_attention, and the copy and tests match the chosen behavior.
索引モデルが issue の本文から書いたものです。
説明
Context
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, N6.
A missing scope at connect parks the whole connection, while the same gap found during a sync does not:
- At connect, any missing scope sets
needs_attention(src/lib/connections/connect.ts:97-98), and aneeds_attentionconnection is never synced (SYNCABLE_CONNECTION_STATUSES,src/lib/jobs/sync-connection.ts:89; skip at:103-107). - During a sync, a partial error adds to
missing_scopesand the connection staysactive(sync-connection.ts:241-246,:290-300). - The docs promise the fallback: "If PostHog does not grant it, signups still sync" (
docs/connect-providers.md:26,docs/providers/posthog.md:11), whiledocs/connect-providers.md:48says a connection that needs attention stops syncing. - Open provider questions that hit this: PostHog
billing:readfor a document-registered app (docs/providers/posthog.md:11), Railway ifscopeomitsworkspace:viewer(docs/providers/railway.md:319), Polar if the user deselects a scope (docs/providers/polar.md:460).
Impact: a user whose grant lacks one optional scope gets a connection that never syncs anything, against what the docs told them, until they reconnect, which may not help if the provider never grants it.
This is a product behavior choice, so the options are below.
| Option | Pros | Cons | Effort | Impact |
|---|---|---|---|---|
Status quo: any missing scope at connect means needs_attention, no sync |
Simple; the user is asked to reconnect at once | Contradicts connect-providers.md:26 and posthog.md:11; a provider that never grants the scope (PostHog billing:read is open) leaves the connection useless forever |
XS (nothing) | Every PostHog, Railway, or Polar user with a partial grant: no data at all, and reconnecting may not fix it |
A. Connect as active with missing_scopes recorded; the sync reads what the grant allows, and a scope the sync cannot do without fails it as permission_missing through the existing path (sync-connection.ts:420, :455-457) |
Matches the docs and the in-sync behavior; one rule for connect and sync; a grant missing an essential scope still ends needs_attention after the first sync |
The connection shows active for one sync before an essential gap is found; relies on each adapter turning a 403 into PermissionMissingError (src/lib/adapters/errors.ts:151-156), which is unconfirmed live |
S | Partial grants sync what they can; the page lists what is missing with a reconnect button |
B. Each adapter declares required and optional scopes; connect sets needs_attention only for a missing required scope |
Precise; an essential gap is caught at connect, not after a sync | A new field on all 11 adapters, decided per provider from documentation that is itself unverified | M | Same as A for users, with earlier feedback on essential gaps |
| C. Refuse the connection at the callback when any scope is missing | No half-working state | Blocks PostHog entirely if billing:read is never granted to this app type; worst outcome for the open questions |
S | Users with a partial grant cannot connect at all |
Files each option touches:
| Option | Files |
|---|---|
| Status quo | none |
| A | src/lib/connections/connect.ts, src/app/w/[workspace]/connections/[connectionId]/page.tsx:256-280, docs/connect-providers.md:26,48, tests |
| B | the same plus src/lib/adapters/types.ts and every src/lib/adapters/<provider>/index.ts |
| C | src/app/api/connections/[provider]/callback/route.ts, connect.ts, docs, tests |
Recommendation: A. The deciding argument: it makes connect follow the rule a sync already follows, so the docs become true without a per-provider table built on unverified facts. Second choice: B, once the real-account pass shows which scopes each provider cannot do without.
Plan
- Eddie picks an option on this issue.
- Implement it in
connect.tsand the connection page copy (page.tsx:256-280) so the notice says what still syncs and what does not. - Make
docs/connect-providers.md:26and:48agree with the behavior.
Acceptance criteria
- The chosen option is recorded on this issue with the reason.
- A PostHog grant without
billing:readconnects and syncs signups (unit test with a partial grant). - A grant missing a scope the sync cannot do without ends
needs_attentionwith the missing scope named. - The connection page copy and
docs/connect-providers.mdmatch the chosen behavior. - Playwright e2e on the connection page notice with an axe scan.
Files and areas
src/lib/connections/connect.ts, src/app/w/[workspace]/connections/[connectionId]/page.tsx, docs/connect-providers.md, tests; option B adds the adapter files.
Non-goals: the failure explanation for other causes (#{n11}).
Verification
npm run typecheck, npm run lint, npx vitest run src/lib/connections, the connections e2e spec.
Branch: <issue-number>-partial-grant-at-connect
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 日以内に返信