Optimistic writes disappear on rows retained from a derived store's draft
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
- 70/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- frontend
Línea de trabajo
Start by examining the store implementation, focusing on how writable derived stores retain rows from drafts and how createOptimisticStore applies updates. Look at the regression tests for #3767 to understand the expected behavior for ordinary writes, then add a similar test case for optimistic writes. The fix should ensure optimistic updates correctly modify retained rows, possibly by copying them as described in the workaround.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
A writable derived store retains a local row across a source refresh:
const [local, setLocal] = createStore<Row[]>(
draft => [...source(), ...draft.filter(row => row.id === "local")],
[],
);
const [view, setView] = createOptimisticStore(local);
After the refresh, an action optimistically sets the retained row's value to 1 and waits two seconds. The optimistic view keeps showing 0 throughout the action.
There are no concurrent actions or pending source updates; the setup updates finish before the action starts.
Your Example Website or App
https://s.olid.uk/id/zG2yQHbUQPa-SyUMiPm_pg
Steps to Reproduce the Bug or Issue
- Open the playground.
- Click Run once. The button creates a local row, refreshes the source, then starts the optimistic action, with 100 ms delays between setup updates.
- Observe that Local value stays at
0during the two-second action.
Expected behavior
The optimistic view should show Local value: 1 while the action is pending, then revert to 0 when the action finishes without persisting the change.
Screenshots or Videos
No response
Platform
- OS: Linux
- Browser: Chromium 153.0.8010.12
- Solid: published preview
mizulu/solid2@5c2174c
Additional context
Returning a copy of the retained row (draft.filter(...).map(row => ({ ...row }))) makes the optimistic update appear and revert as expected. Both variants were tested in the browser.
The retained-draft-row pattern is already covered for ordinary writes by the regression tests for #3767. This report concerns optimistic writes over that store.
The playground has Tailwind disabled.
- Lenguaje dominante
- TypeScript
- Estrellas
- 36.1k
- Forks
- 1.1k
- Merge medio
- 13 h 13 min
- PR fusionados (30 d)
- 306
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 solidjs/solid
-
Dev diagnostics: ABANDONED_FLIGHTS fires on streamed frame slot args that supersede by designAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 Medio día Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Per-scope takeover for live nodes whose server value is still streaming (D8 follow-up to #3817)Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
Todos los issues de solidjs/solid
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