Skip to content

2.0.0-rc.8 onSettled reads inconsistent values during an optimistic revert #3411

Description

@GabbeV

Describe the bug

When an optimistic update reverts, onSettled reads 0 from the optimistic value but 1 from a synchronous memo that just returns that value.

Your Example Website or App

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

Steps to Reproduce the Bug or Issue

  1. Click Run.
  2. Value and Copy become 1, then revert to 0.
  3. The captured onSettled snapshot says Value: 0, Copy: 1.

Expected behavior

The callback reads a consistent settled state: both values are 0.

Screenshots or Videos

No response

Platform

  • OS: Windows
  • Browser: Firefox

Additional context

Reproduced on next at 14ded24, #3337 at 20f3143 and #3405 at 323f9ad.

Replacing createOptimistic with createSignal produces a consistent snapshot. The mismatch also reproduces without an action or delay.

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