Optimistic store update is hidden after a local derived-store write inside an action
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, typescript
- Área
- frontend
Línea de trabajo
The report provides a playground reproduction but names no source files or tests. Start by running the reproduction and tracing how createOptimisticStore handles the local derived-store write and the following optimistic write while the action is pending. Done means the view shows New / saving: true during the save and reconciles to the authoritative source after completion.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
On experimental build 6f77b1b, writing a client-only flag to a writable derived store inside an action prevents a subsequent optimistic store update from appearing while that action is pending.
The optimistic store wraps the derived store. The local write only sets failed = false; the optimistic write changes title to "New" and sets saving = true. A direct JSX binding keeps showing "Old" and saving: false until the action completes.
const [cards, setOptimistic] = createOptimisticStore(local);
const save = action(function* () {
setLocal(draft => { draft[0].failed = false; });
setOptimistic(draft => {
draft[0].title = "New";
draft[0].saving = true;
});
yield completion;
});
Removing the setLocal call makes the optimistic update appear. The reproduction uses a normal component and direct text binding, without For, Show, routing, or external data loading.
Your Example Website or App
https://s.olid.uk/id/d27cf7de-2cc1-45a8-9144-6868e307a78f
Steps to Reproduce the Bug or Issue
- Open the playground and click Run once.
- During the two-second simulated save, observe
Old / saving: falseinstead of the optimistic values. - After completion, the display changes to
New / saving: false. The report records both states. - Reload and remove the marked
setLocalcall to compare: the optimistic values appear during the save.
Expected behavior
The optimistic view should immediately show New / saving: true while the action is pending, including when the action first writes to its underlying local store. After completion, it should follow the authoritative source with the temporary saving flag removed.
Platform
- OS: Linux (Ubuntu / WSL)
- Browsers: Chromium 153.0.8010.12 and Firefox 155.0; identical results
- Solid:
solid-js,@solidjs/web, and@solidjs/signalsfrom the Zulu6f77b1bpreview: https://github.com/mizulu/solid2/issues/1#issuecomment-5993985409 - Native compiler:
@solidjs/compiler2.0.0-rc.13
Additional context
The identical reproduction with published RC.13 is here: https://s.olid.uk/id/cf602874-eee9-400c-bd96-3022a77b7291
| With the local flag write | RC.13 | 6f77b1b |
|---|---|---|
| During the pending action | New / saving: true |
Old / saving: false |
| After completion | Old / saving: false |
New / saving: false |
RC.13 shows the optimistic update correctly but suppresses the later source reconciliation discussed in #3733. The newer build reconciles correctly after completion, but loses the optimistic display while pending. Both playgrounds have Tailwind disabled.
- Lenguaje dominante
- TypeScript
- Estrellas
- 36.1k
- Forks
- 1.1k
- Merge medio
- 11 h 42 min
- PR fusionados (30 d)
- 326
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
-
[2.0 next, regressed after rc.13] Async-generator action times out on its authoritative live echoAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 Medio día Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 64/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
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
Todos los issues de solidjs/solid
Issues similares
-
ble-needs-fable-review bug mobile priority:P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
ColeMurray/background-agents#2305 ·
Los mantenedores suelen responder en 1 día
-
bug from-studio
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
esengine/DeepSeek-Reasonix#12355 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
oblien/openship#1086 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día