Skip to content

[13.x] Promote nested data to top-level managed queue event - #61209

Merged
taylorotwell merged 7 commits into
laravel:13.xfrom
timacdonald:managed-queues
Aug 17, 2026
Merged

[13.x] Promote nested data to top-level managed queue event#61209
taylorotwell merged 7 commits into
laravel:13.xfrom
timacdonald:managed-queues

Conversation

@timacdonald

@timacdonald timacdonald commented Aug 17, 2026

Copy link
Copy Markdown
Member

Managed queue event payload improvements.

Once merged, this will be back ported to all versions supporting managed queues.

@timacdonald
timacdonald requested a lite review from Copilot August 17, 2026 00:35
@github-actions

Copy link
Copy Markdown

Thanks for submitting a PR!

Note that draft PRs are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Laravel Cloud managed-queue failed job telemetry to surface key nested fields (job display name and a compact exception preview) as top-level event properties, and expands test coverage around exception preview formatting and UTF-8 handling.

Changes:

  • Add exception_preview (truncated) and job_name to the managed queue failed_job event payload.
  • Expand Cloud queue tests to validate exception preview formatting (with/without message), UTF-8 sanitization, and job display name promotion.
  • Update the Events test double to parse the JSON stream written by Illuminate\Foundation\Cloud\Events.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tests/Foundation/Cloud/QueueTest.php Adds/adjusts assertions for exception_preview, job_name, UTF-8 sanitization, and upgrades the Events fake to decode written JSON lines.
src/Illuminate/Foundation/Cloud/FailedJobProvider.php Emits new top-level fields (exception_preview, job_name) for managed-queue failed job events.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/Foundation/Cloud/QueueTest.php Outdated
Comment thread src/Illuminate/Foundation/Cloud/FailedJobProvider.php Outdated
limit: 1000,
end: '[truncated due size...]'),
'job_name' => $payload['displayName'] ?? '',
'exception' => (string) $exception,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

mb_convert_encoding is redundant here. Our event class handles converting everything to UTF-8.


foreach (explode("\n", rtrim($payload, "\n")) as $write) {
$this->emitted[] = json_decode($write, associative: true);
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This refactor allows us to see what was really sent to the socket after being encoded. This helps with our UTF-8 assertions.

'payload' => $payload,
'exception' => (string) mb_convert_encoding($exception, 'UTF-8'),
'exception_preview' => mb_substr(
string: $exception->getMessage()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@timacdonald
timacdonald marked this pull request as ready for review August 17, 2026 11:37
@taylorotwell
taylorotwell merged commit 30788c8 into laravel:13.x Aug 17, 2026
53 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.

3 participants