Skip to content

[2.0 / next] Outside latest reads of a derivation expose errors and values at different times #4106

Closed

Description

@GabbeV

Describe the bug

With derived = createMemo(() => latest(source)), outside reads of latest(derived) expose successful and failed outcomes at different points during a held update.

A successful result becomes readable before the frame reveals. A rejection only becomes observable through the derivation after reveal, even though direct latest(source) already throws it. An async sibling keeps the frame held in both cases.

Your Example Website or App

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

Steps to Reproduce the Bug or Issue

Wait for Derived effect: 1 and Committed round: 1. The Read latest button samples both accessors from an event handler, outside a reactive computation.

Rejected result:

  1. Click Start update, then Reject source.
  2. Click Read latest. The output shows latest(source): boom but latest(derived): 1. The read helper catches thrown errors and displays their messages. The committed round remains 1 because the sibling is still pending.
  3. Click Release sibling, then Read latest again. Both reads now throw boom, and the committed round is 2.

Successful result:

  1. Reload the playground.
  2. Click Start update, then Resolve source to 2 (control).
  3. Click Read latest before releasing the sibling. Both reads already return 2, while the committed round remains 1.

Expected behavior

Outside reads should follow a consistent publication rule for successful and failed outcomes.

The point at which latest(derived) exposes a new outcome should not depend on whether the source fulfills or rejects.

Screenshots or Videos

No response

Platform

Additional context

Related to #4085. Both the rejection and fulfillment paths were verified in the hosted playground.

The related publication rules are D-22 and D-41.

Activity

  1. ryansolid commented on Oct 18, 2026

    @ryansolid
    Member

    Fixed by #4129, which carries @brenelz's #4113 and is now merged into next (7093b07). Outside a latest read, a derivation now shows a held error at the same time it would show a held value. The tests in that PR fail on the previous next and pass now. It ships in the next 2.0 RC.

    — Claude via Claude Code


    Generated by Claude Code

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