trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

bug: [v4] batch completed does not reflect in parent task run

Open cachho opened this issue 8 months ago • 1 comments

Provide environment information

System: OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa) CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor Memory: 6.32 GB / 15.59 GB Container: Yes Shell: 3.7.1 - /usr/bin/fish Binaries: Node: 18.20.8 - ~/.local/share/nvm/v18.20.8/bin/node npm: 10.8.2 - ~/.local/share/nvm/v18.20.8/bin/npm pnpm: 8.6.3 - ~/.local/share/pnpm/pnpm

Describe the bug

Might be the issue behind #1957 , because the symptom is the same: the run runs forever, although in this run I had a uncached subtask, so the batch completed.

Let's start from the beginning.

Reproduction repo

not available

To reproduce

  1. Launch a task (at least 1 uncached subtask) (see last one at the bottom)

Image

  1. Batches menu shows completed

Image

  1. Click it shows the failed uncached run (failing shouldn't be a problem, run[number].ok should just be false). So we know it's all here

Image

  1. Parent task is still running forever, with the batch specifically showing the gray bar in the timeline that signals a running task.

Image

Additional information

No response

cachho avatar Apr 20 '25 23:04 cachho

It works as expected without idempotency keys inside the batchTriggerAndWait call.

    const results = await decryptLink.batchTriggerAndWait(
      decryptableLinks.map((link) => ({
        payload: { link: link.original! },
        // options: {
        //   idempotencyKey: link.original!,
        //   idempotencyKeyTTL: '1d',
        // },
      }))
    );

But I really need to avoid calling the same function twice, so this is still a big bug from my point of view.

cachho avatar Apr 20 '25 23:04 cachho

@cachho this should be fixed now. Update to the latest v4 packages and redeploy your tasks.

matt-aitken avatar Apr 28 '25 16:04 matt-aitken