Persisted on-demand Electric collection enters error after a committed transaction waits across subset hydration
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- databases
Línea de trabajo
Start by reading the transaction-boundary and hydration logic in applyBufferedSyncTransactionUnsafe, applyTransactionToCollection, loadSubset, and assertHydrationSequenceCurrent. Trace the reported sequence: a commit accepted at generation 0 is published after two subset hydrations. Done means accepted commits publish and persist consistently despite delayed publication, while genuinely open transactions crossing hydration cycles are still rejected; no reproduction or test file is named in the issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Observed behavior
With @tanstack/db-sqlite-persistence-core 0.4.3 and @tanstack/browser-db-sqlite-persistence 0.2.28, on-demand Electric collections enter a terminal error state during normal startup/subset loading:
InvalidPersistedCollectionConfigError: a persisted sync transaction cannot cross a hydration cycle
This surfaces as live-query source errors for jobs and documents.
Captured runtime sequence
Instrumentation around the source transaction boundaries, hydration generation changes, and publication captured this ordering for the jobs collection:
- Electric begin and commit both execute at hydration generation 0.
- Two persisted subset hydrations run, advancing the generation to 1 and then 2.
- applyBufferedSyncTransactionUnsafe calls applyTransactionToCollection for the already-committed transaction.
- The transaction has hydrationSequence=0, current generation=2, queuedBecauseHydrating=false, and internal=false. assertHydrationSequenceCurrent throws and the source enters error state.
The application did not keep the transaction open across these hydrations. Commit was accepted before the generation changed; publication happened later inside persistence scheduling.
Expected behavior
An accepted source commit should publish and persist in a consistent order with subsequent subset hydration, without invalidating the source merely because the persistence queue delayed publication. The existing rejection of genuinely open transactions crossing hydration cycles should remain.
Current source and related coverage
Current main still records the generation at external begin, validates it at commit, and validates it again at delayed publication. loadSubset schedules hydration through the same apply mutex and advances the generation.
Related: https://github.com/TanStack/db/pull/1911 covers a transaction beginning during hydration and committing after that hydration closes. This report concerns a commit accepted before later hydrations execute.
An isolated deterministic regression and fix are being investigated. No minimal standalone reproduction or tested upstream patch is attached yet. Disabling persistence for on-demand collections avoids the captured failure in the application; eager persistence remains enabled.
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.9k
- Forks
- 268
- Merge medio
- 1 d 3 h
- PR fusionados (30 d)
- 193
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TanStack/db
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Debounce and throttle paced mutations allow concurrent persistence despite the documented single-flight contractPosiblemente ocupada @KyleAMathews la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
TanStack/db#1972 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
Todos los issues de TanStack/db
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
rajbos/ai-engineering-fluency#2340 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
community documentation first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
lingdojo/kana-dojo#31864 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
zenstackhq/zenstack#2873 ·
Los mantenedores suelen responder en 1 día
-
CLI: TUI shows onboarding when the provider's API key is only in the environment (e.g. OPENROUTER_API_KEY)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. AbiertoCLI
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
cline/cline#14923 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
paperclipai/paperclip#15490 ·
Los mantenedores suelen responder en 1 día