Skip to content

Conversation

@Mortalife
Copy link
Contributor

@Mortalife Mortalife commented Jan 1, 2026

Checklist for Pull Requests

  • All tests pass (yarn test:all and yarn test:integration)
  • Code follows the style guide and passes lint checks
  • Documentation is updated (README, docs, etc)
  • Linked to corresponding issue, if applicable
//  yarn test:all

 Test Files  41 passed (41)
      Tests  1002 passed | 1 skipped (1003)
   Start at  20:16:07
   Duration  144.54s (transform 2.09s, setup 670ms, collect 8.39s, tests 119.99s, environment 14ms, prepare 5.70s)

Summary of Changes

#150

Updated the SnoozeTransition transition to correctly transition jobs which are claimed but are not executable because of queue restrictions, back to waiting to retry execution.

@Mortalife Mortalife changed the title fix/correct state transition requirements fix: correct state transition requirements Jan 2, 2026
@Mortalife
Copy link
Contributor Author

Changed to master and ran yarn test:integration locally and they're still failing. So I'm not convinced it's caused by this change.

@merencia
Copy link
Contributor

merencia commented Jan 2, 2026

there is at least 1 testing failing because of your change:

expect(snoozedJob.state).toBe("waiting");

the initial job state is waiting you remove it here: https://github.com/sidequestjs/sidequest/pull/151/changes#diff-4f83360c934e910471ab637a5973f86e0243c1fc3d0d8f1f7fe99aceaeb345feL43


shouldRun(job: JobData): boolean {
return ["waiting", "running"].includes(job.state);
return ["claimed", "running"].includes(job.state);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep waiting, running and claimed.

we should be able to programmatically snooze a waiting job.

@Mortalife
Copy link
Contributor Author

expect(snoozedJob.state).toBe("waiting");

We're expecting the outcome of the snooze to be "waiting" here which is what snooze does, so this shouldn't error? But I'll also include the original waiting, even though it's a no-op.

@merencia
Copy link
Contributor

merencia commented Jan 2, 2026

Sorry, linked the wrong code.

When creating the job using the builder the default and initial state of the job is waiting, this is the right code: https://github.com/sidequestjs/sidequest/blob/master/packages/engine/src/job/job-builder.ts#L233

Sharing more about the feature, let's say a job was scheduled, and for some reason you have to postpone it's execution. Then a snooze call should do the trick, so basically we should be able to move a job from waiting to waiting changing the availableAt

@merencia merencia merged commit c3c2fe9 into sidequestjs:master Jan 2, 2026
2 checks passed
sidequest-release bot pushed a commit that referenced this pull request Jan 2, 2026
## [1.13.2](v1.13.1...v1.13.2) (2026-01-02)

### Bug Fixes

* allowing snooze claimed jobs ([#151](#151)) ([c3c2fe9](c3c2fe9))
@sidequest-release
Copy link

🎉 This PR is included in version 1.13.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Mortalife Mortalife deleted the patch-1 branch January 2, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants