Explore with sample data can connect the simulated providers twice when clicked in two tabs

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

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
58/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
nextjs, typescript
領域
backend, database

調査の方向性

Read exploreWithSampleData in src/app/w/[workspace]/connections/actions.ts:353-384 alongside sampleDataRefusal and addSampleData in src/lib/demo/workspace.ts:209-228, then follow connectSimulatedProviders to see the inserts. Check how the existing tests set up a workspace and database transactions before adding a concurrent case. Done means two overlapping calls leave exactly one set of simulated connections and the losing call returns the existing refusal message rather than an error.

索引モデルが issue の本文から書いたものです。

説明

area: workspaces bug impact: low priority: P3 size: S

Summary

"Explore with sample data" (#257, merged into integration/demo-2026-11 in #282) checks that the workspace has no connections, then connects every simulated provider. The check and the insert are separate steps, so two submits that overlap (two tabs, or a double submit) can both pass the check and connect a second set of simulated providers to the same workspace.

Found by the #257 worker while finishing #282; reported in its handoff, not fixed there because it is outside that issue's acceptance criteria.

Evidence

  • exploreWithSampleData in src/app/w/[workspace]/connections/actions.ts:353-384 counts connections for the workspace, calls sampleDataRefusal (src/lib/demo/workspace.ts:209-215), then calls addSampleData, with nothing between the count and the insert that holds a lock or a unique constraint.
  • addSampleData (src/lib/demo/workspace.ts:228) calls connectSimulatedProviders, which inserts one connection per simulated provider.
  • Not reproduced in a browser yet: the race is read from the code.

Scope

  • Make the "empty workspace" rule hold under concurrent submits, in the database rather than in the action (for example a transaction-scoped advisory lock on the workspace, or an insert that re-checks emptiness atomically).
  • The second submit gets the existing "This workspace already has connections" message.

Acceptance criteria

  • Two concurrent exploreWithSampleData calls for one empty workspace produce exactly one set of simulated connections.
  • The losing call returns the existing refusal message, not an error.
  • A test covers the concurrent case.

Decisions needed

None.

Model: anthropic/claude-opus-5-5 | Reasoning effort: low

主要言語
TypeScript
スター
1
フォーク
1
平均マージ
6時間 56分
マージ済み PR(30日)
136

環境構築

はじめの一歩

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

eddiejaoude/StackDash のほかの issue

eddiejaoude/StackDash の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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