Skip to content

Capture streaming responses - #1070

Merged
barryvdh merged 7 commits into
masterfrom
feat-capture-streaming
Jul 2, 2026
Merged

Capture streaming responses#1070
barryvdh merged 7 commits into
masterfrom
feat-capture-streaming

Conversation

@barryvdh

@barryvdh barryvdh commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Inject a correlation request ID to match streams without possibility to add headers after the response.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds a client/server correlation mechanism to allow the AJAX handler to associate “streamed” responses (where response headers may be committed early) with a stored DebugBar dataset via a request correlation ID (rid).

Changes:

  • Add rid to collected __meta and allow it as an OpenHandler find filter.
  • Extend the JS AjaxHandler to optionally inject a ${headerName}-request-id request header on same-origin fetch/XHR and fall back to an OpenHandler lookup when the response headers don’t contain the dataset ID.
  • Expose new JavascriptRenderer options + documentation for enabling and configuring streamed correlation behavior.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/OpenHandler.php Allows rid as a filter key passed through to storage find() operations.
src/JavascriptRenderer.php Adds configuration knobs to enable streamed correlation and configure content-types, and emits corresponding JS initialization.
src/DebugBar.php Captures/sanitizes the incoming correlation request header into __meta.rid.
resources/debugbar.js Implements request-id injection + streamed-response fallback dataset lookup via OpenHandler.
docs/docs/ajax-and-stack.md Documents the streamed response limitation and how to enable correlation fallback.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread resources/debugbar.js
Comment thread resources/debugbar.js
Comment thread resources/debugbar.js
barryvdh and others added 5 commits July 2, 2026 14:30
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@barryvdh
barryvdh merged commit 18ced90 into master Jul 2, 2026
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