Skip to content

Optimistic store property readers stay stale after reconciliation removes a property #3883

Description

@GabbeV

Describe the bug

When an action adds an optimistic row and then retains it in a writable derived store with createFailed: true, a later source update reconciles the row without that property. Both the derived store and its optimistic view then contain { id: "A" }, but JSX reading cards[0]?.createFailed continues displaying Error.

The action has already settled before the source update. There are no pending actions when the stale UI remains.

Your Example Website or App

https://s.olid.uk/id/iKS1wleST9GNN_nKlC2RDg

Steps to Reproduce the Bug or Issue

  1. Open the reproduction and click Run once.
  2. The action optimistically inserts a row, then retains it with createFailed: true after 100 ms.
  3. After that action settles and another 200 ms passes, the source supplies { id: "A" }.
  4. The page remains on Error, although reconciliation has removed createFailed from both stores.

Expected behavior

The page should return to Confirmed when reconciliation removes createFailed, since reading the property now returns undefined.

Screenshots or Videos

No response

Platform

  • OS: Linux (WSL)
  • Browser: Chromium 153
  • Solid: Zulu preview bc51ada (solid-js, @solidjs/signals, @solidjs/web)

Additional context

Controls tested against the same build:

  • Removing createOptimisticStore and rendering the derived store directly updates to Confirmed.
  • Supplying { id: "A", createFailed: false } instead also updates correctly.
  • The failure reproduces without For, routing, or a database.

Direct snapshots after the source update show source, local, and cards all equal to [{ "id": "A" }], while the property-dependent JSX still displays Error.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions