Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

2.0.0-rc.14: until() through a synchronous memo misses optimistic confirmation

Aperta
#3,943 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
  1. Open the playground and click 1. Start.
  2. The displayed count becomes 1 and the doubled memo becomes 2. Action completion remains false, as expected while the prediction is unconfirmed.
  3. Click 2. Confirm to set the actual source to 1.
  4. Action completion still remains false.
  5. Change the wait to yield until(() => count() === 1), rebuild, and repeat. Action completion becomes true after 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
Lingua principale
TypeScript
Stelle
36.1k
Fork
1.1k
Merge medio
11h 34m
PR unite (30g)
341

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di solidjs/solid

Tutte le issue di solidjs/solid

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.