Capture streaming responses - #1070
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
ridto collected__metaand allow it as an OpenHandlerfindfilter. - Extend the JS AjaxHandler to optionally inject a
${headerName}-request-idrequest 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
JavascriptRendereroptions + 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.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Inject a correlation request ID to match streams without possibility to add headers after the response.