Skip to content

Adding combined isPending breaks atomic publication #3442

Description

@GabbeV

Describe the bug

Two async memos derive from the same signal. Reading isPending(() => [fast(), copy()]), where copy is a synchronous memo wrapping the slow result, makes Fast display 1 while Slow still displays 0. Pending reports false during this interval.

Removing the pending read makes both values update together.

Your Example Website or App

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

Steps to Reproduce the Bug or Issue

  1. Wait for initialization.
  2. Click Run.
  3. Fast becomes 1 while Slow remains 0 and Pending reports false.
  4. After one second, Slow becomes 1.

Expected behavior

The pending read should not cause a partially published update. Both values should update together, with Pending true until they are ready.

Screenshots or Videos

No response

Platform

Verified with compiled JSX in jsdom on Node.js 24.18.0, in development and production builds.

Additional context

Reproduced on next at efcaeba.

Possibly related to #3409/#3425, but this uses an ordinary signal update and a synchronous memo after the slow async memo. Replacing copy with a plain getter also removes the problem.

This reduced repro passes on #3337 at 20f3143 and its base b5bd6fb, so that passing result does not establish that #3337 fixes the current failure.

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