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

Solid 2: reconcile repeats unchanged presence and holds unrelated updates

Chiusa
#3,743 1 commento 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
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Start with packages/signals/src/store/next/store.ts, especially notifyFold and notifyFoldTail, then run the linked playground reproduction. Add an isolated regression test for the unchanged-absence case and verify that Value: 1 renders while the deletion action remains pending, while actual presence changes still notify.

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

Descrizione

Describe the bug

Reconciling a plain store can hold an unrelated field's rendered update behind a pending action when a separate in expression observes a property that the action deleted. The incoming snapshot leaves that property absent, matching its already-staged presence.

Reproduction

One-button playground — preview 3ed3810, Tailwind disabled.

Click Build, then Run reproduction. The sequence is:

// Initial store: { a: { value: 0 }, b: { failed: true } }
const removeFlag = action(function* () {
  setState(draft => { delete draft.b.failed; });
  yield gate;
});

// In a later event, while removeFlag is pending:
setState(reconcile({ a: { value: 1 }, b: {} }));

The component separately renders state.a.value and "failed" in state.b; no memo combines them. The playground releases the action after 2.5 seconds.

Expected: Value: 1 appears while the deletion action remains pending.

Actual: Value: 0 remains until that action finishes, then becomes 1.

Controls and investigation

Verified in Chromium and Firefox, in development and production builds:

  • Removing the separate presence expression allows the value to update immediately.
  • Assigning failed = false instead of deleting it, and reconciling the same false, allows it to update immediately.
  • Writing a.value = 1 directly instead of reconciling allows it to update immediately.

The suspected cause is the presence notification in notifyFold and notifyFoldTail. Value notifications compare old/new values, but the presence loops call setSignal for every observed key without comparing presence. The core joins the node's holding transaction before rejecting an equal value, so repeating false can entangle the reconciliation with the deletion action.

Adding an old/new presence comparison to both loops in an isolated test bundle prevents the hold. This is diagnostic evidence, not a fully validated patch.

Actual presence changes must still notify: deleting a prop override can select another merge source even when the resulting value is equal. This reproduction has no merge or provider switch; the suspected problem is the repeated absence-to-absence notification.

Version

solid-js and @solidjs/web from https://pkg.pr.new/mizulu/solid2/...@3ed3810 (Solid commit 3ed3810097bfc5e5d15829277b40315bbd2b5f74).

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.