Skip to content

2.0.0-rc.8 conditional memo disagrees with its inputs during a held branch change #3410

Description

@GabbeV

Describe the bug

selected = createMemo(() => fixed() ? 2 : count()) shows 0 while Fixed is false and Count is 1. With those inputs, Selected should be 1.

Your Example Website or App

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

Steps to Reproduce the Bug or Issue

  1. Wait for initialization.
  2. Click Run.
  3. Count becomes 1 while Fixed remains false and Selected remains 0.

Expected behavior

Selected should equal Count while Fixed is false.

Screenshots or Videos

No response

Platform

  • OS: Windows
  • Browser: Firefox

Additional context

The async details memo holds the branch change. Updating Count during that hold exposes the mismatch. Keeping Count as an unconditional dependency removes it.

Reproduced on next at 14ded24. The earlier equivalent repro also reproduces on #3337 at 20f3143 and #3405 at 323f9ad.

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