Skip to content

fix(queue): preserve dtoClass through failed jobs and requeue - #196

Merged
markstory merged 1 commit into
cakephp:3.xfrom
skie:feature/failed-jobs-dto
Sep 25, 2026
Merged

markstory merged 1 commit into
cakephp:3.xfrom
skie:feature/failed-jobs-dto

Conversation

@skie

@skie skie commented Sep 22, 2026

Copy link
Copy Markdown
Member

fix(queue): preserve dtoClass through failed jobs and requeue

Problem

Failed jobs silently dropped the DTO marker: FailedJobsListener
persisted only data + requeueOptions, and RequeueCommand
re-pushed without dtoClass. A requeued DTO job came back as a
plain array and Message::getDto() could no longer rehydrate it.

Changes

  • Migration AddDtoClassToFailedJobs: nullable dto_class on
    queue_failed_jobs (legacy rows unaffected)
  • FailedJobsListener stores body['dtoClass'] into dto_class
    (null for legacy bodies without the key)
  • RequeueCommand passes dto_class back as the push() dtoClass
    option (null = previous behaviour, nothing added to the body)
  • FailedJob entity/table: $_accessible, validation, phpdoc;
    tests/schema.php + FailedJobsFixture records updated

Failed jobs dropped the DTO marker: FailedJobsListener persisted only
data + requeueOptions, and RequeueCommand re-pushed without dtoClass,
so a requeued DTO job came back as a plain array and getDto() could
no longer rehydrate it.
@markstory markstory added this to the 3.x milestone Sep 25, 2026
@markstory
markstory merged commit 33660c0 into cakephp:3.x Sep 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants