Skip to content

Solid v2.0.0-beta.10 batched parent & derived signals manual update is neglected for derived signals #2692

Closed

Description

@maciek50322

Describe the bug

When updating parent signal and derived signal in one "batch", the derived signal update has no effect independent of update order.

const [original, setOriginal] = createSignal(0);
const [derived, setDerived] = createSignal(original);

function onClick() {
  setOriginal(1); // sets both derived signals to 1
  setDerived(2); // doesn't do anything
}

This happens only for first call of onClick, because on second call original signal already has new value and so doesn't update - this allows derived signal to update.

This can be mitigated right now with flush

function onClick() {
  setOriginal(1); // sets both derived signals to 1
  flush();
  setDerived(2); // sets derived signal to 2
}

but flush can't be used in e.g. onSettled
and flushing it at that point makes more updates

Your Example Website or App

https://s.olid.uk/id/iMjvvK2zQbi-c6TJvUWsDA

Steps to Reproduce the Bug or Issue

  1. Go to link
  2. Click the button
  3. See that both signals have value of 1 instead of 1 and 2
  4. Click the button again
  5. See that signals have now values of 1 and 2

Expected behavior

Updates to signals should be applied in call order.

Screenshots or Videos

No response

Platform

  • OS: Windows 10
  • Browser: Chrome
  • Version: Solid v2.0.0-beta.10

Additional context

No response

Activity

  1. changed the title [-]Solid v2.0.0-beta.10 batched signals manual update is neglected for derived signals[/-] [+]Solid v2.0.0-beta.10 batched parent & derived signals manual update is neglected for derived signals[/+] on May 4, 2026
  2. ryansolid commented on May 4, 2026

    @ryansolid
    Member

    There is still an open question about order. Making order matter would be pretty difficult because things don't evaluate immediately (without flush). So we have to take a side I believe write should override recompute, but order isn't going to matter here I think. Simply write trumps derivation on the same tick.

    Derived Stores are trickier. The only way to be consistent is have them similarly cancel. It isn't really possible to enforce ordering and to know the state you are in coming in to either.

  3. ryansolid commented on May 11, 2026

    @ryansolid
    Member

    I just went with write beats derived in the same tick. Fixed in beta.11.

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