mirror of
https://github.com/mastra-ai/mastra.git
synced 2026-11-17 08:44:46 +00:00
fix(core): drop resume events that answer an earlier suspension
A task.resume event carried only taskId and resumeData, and handleResume claimed the row fenced on status alone. If the task was resumed another way, ran, and suspended again before the event was handled, the stale event resumed the new suspension with the old data. The event now carries the suspension token it answers. handleResume drops it when the row's token differs, and claims the row with expectedSuspendedAt so a re-suspension between the read and the claim is rejected too. Events without the token (older publishers during a rolling deploy) keep the status-only check. Portable and process-affine resumes share this path. Co-Authored-By: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
This commit is contained in:
parent
cb87e14e0d
commit
c0f6544ee1
3 changed files with 121 additions and 6 deletions
Loading…
Add table
Add a link
Reference in a new issue