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

Abierto
#287 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
58/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
nextjs, typescript
Área
backend, database

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
1
Forks
1
Merge medio
6 h 56 min
PR fusionados (30 d)
136

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de eddiejaoude/StackDash

Todos los issues de eddiejaoude/StackDash

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.