2.0.0-rc.14: until() through a synchronous memo misses optimistic confirmation
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
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- frontend
Línea de trabajo
Start by reproducing with the playground component in the issue, then swap the predicate between doubled() and count() to confirm the memo is the difference. The payload names no source files, so you will need to find where until() subscribes and how a synchronous createMemo propagates optimistic values on confirmation. Done when yield until(() => doubled() === 2) completes after setSource(1), matching the direct-read control.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
On 2.0.0-rc.14, an action waiting with until() through a synchronous memo remains pending when the actual source confirms its optimistic prediction. Reading the optimistic accessor directly in the predicate completes the same action.
The predicate subscribes before confirmation arrives. The prediction alone correctly does not satisfy the wait, but confirming it does not resolve the wait through the memo either.
Your Example Website or App
https://s.olid.uk/?id=d1d1a3ee-70c8-4afe-966d-258809cb4f06
The playground uses published 2.0.0-rc.14. Here is the full component, including the actual source update in the Confirm button:
import { action, createMemo, createOptimistic, createSignal, until } from "solid-js";
import { render } from "solid-js/web";
function App() {
const [source, setSource] = createSignal(0);
const [count, guess] = createOptimistic(() => source());
const doubled = createMemo(() => count() * 2);
const [completed, setCompleted] = createSignal(false);
const save = action(function* () {
guess(1);
yield Promise.resolve();
// Direct-read control: yield until(() => count() === 1);
yield until(() => doubled() === 2);
});
return (
<main>
<button onClick={() => save().then(() => setCompleted(true))}>1. Start</button>
<button onClick={() => setSource(1)}>2. Confirm</button>
<p>Displayed count: {count()}</p>
<p>Doubled memo: {doubled()}</p>
<p>Action completed: {String(completed())}</p>
</main>
);
}
render(() => <App />, document.getElementById("app")!);
Steps to Reproduce the Bug or Issue
- Open the playground and click 1. Start.
- The displayed count becomes
1and the doubled memo becomes2. Action completion remainsfalse, as expected while the prediction is unconfirmed. - Click 2. Confirm to set the actual source to
1. - Action completion still remains
false. - Change the wait to
yield until(() => count() === 1), rebuild, and repeat. Action completion becomestrueafter confirmation.
Both the failing memo case and the successful direct-read control were verified in the browser.
Expected behavior
The optimistic prediction alone should not satisfy until(). Once the actual source confirms the prediction, the predicate through the synchronous memo should resolve and the action should complete, just as the direct-read predicate does.
Platform
- OS: Linux (WSL)
- Browser: Chrome for Testing 153.0.8010.12, tested with Playwright
- Solid:
2.0.0-rc.14
- Lenguaje dominante
- TypeScript
- Estrellas
- 36.1k
- Forks
- 1.1k
- Merge medio
- 10 h 42 min
- PR fusionados (30 d)
- 361
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
-
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 8/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 82/100
Los mantenedores suelen responder en 1 día
-
status:approved type:bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
egdev6/quorb#109 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
stage:4
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
ilan-pinto/roaring-lions#598 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Frontmatter next to `src:` is applied to every imported slide, not only the first (undocumented)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día