Skip to content

Async derived in each loop with multiple batches causing infinite loop #18355

@dummdidumm

Description

@dummdidumm

Describe the bug

If you have

  • an each loop
  • using a derived
  • with async work inside the each block
  • and you create multiple batches (e.g. by causing overlapping async work)

Then you run into an infinite loop. It happens because

  • In batch.#traverse we add blocks to maybe_dirty, so the each block will always be maybe dirty
  • In deriveds.js we don't reset the status of the derived if batch_values is present, so the derived always stays dirty
  • -> In combination this means the each block keeps rerunning

Reproduction

playground - spam the button a few times and observe that the log keeps showing up, i.e. the derived keeps rerunning.

Logs

System Info

-

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions