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

Aperta
#287 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
nextjs, typescript
Ambito
backend, database

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
1
Fork
1
Merge medio
6h 56m
PR unite (30g)
136

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eddiejaoude/StackDash

Tutte le issue di eddiejaoude/StackDash

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.