Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WebProfilerBundle] add debugbar onStreamedResponse#58789

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
damienfern wants to merge4 commits intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromdamienfern:streamResponse_webdebugToolbar

Conversation

damienfern
Copy link
Contributor

@damienferndamienfern commentedNov 6, 2024
edited
Loading

QA
Branch?7.3
Bug fix?no
New feature?yes
Deprecations?no
IssuesFix#57288
LicenseMIT


class MockedStreamedResponse extends StreamedResponse
{
public function getContent(): string|false
Copy link
Member

Choose a reason for hiding this comment

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

I would not override thegetContent method of StreamedResponse for that, as it means this MockedStreamedResponse does not actually behave like a StreamedResponse (in which youcannot callgetContent to get the actual content), which would potentially hide bugs in tests.

Instead, I would suggest writing a separate test covering the injection of the toolbar in a streamed response, which would perform this output buffering in the test (using$response->sendContent()).

damienfern reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

You're right and indeed I missed a bug on StreamedResponsehere.

Let me know if it's ok for you.

@damienferndamienfernforce-pushed thestreamResponse_webdebugToolbar branch 2 times, most recently from9a631e3 to642ebedCompareNovember 7, 2024 16:59
@fabpotfabpot modified the milestones:7.2,7.3Nov 20, 2024
@OskarStarkOskarStark changed the title[WebProfilerBundle] add debugbar on StreamedResponse[WebProfilerBundle] add debugbar on `StreamedResponse´Nov 21, 2024
@damienferndamienfernforce-pushed thestreamResponse_webdebugToolbar branch fromac59dd8 to5f7393bCompareJanuary 24, 2025 10:30
@damienferndamienfernforce-pushed thestreamResponse_webdebugToolbar branch from5f7393b to6f0f764CompareJanuary 24, 2025 10:31
@damienferndamienfernforce-pushed thestreamResponse_webdebugToolbar branch from7787e2a to677f95cCompareJanuary 24, 2025 10:38
@damienferndamienfern requested a review fromstofJanuary 24, 2025 10:47
@OskarStarkOskarStark changed the title[WebProfilerBundle] add debugbar on `StreamedResponse´[WebProfilerBundle] add debugbar onStreamedResponseJan 24, 2025
@@ -5,6 +5,7 @@ CHANGELOG
---

* Add `ajax_replace` option for replacing toolbar on AJAX requests
* Show debug bar when using a streamed response

Choose a reason for hiding this comment

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

Suggested change
*Show debug bar when using a streamed response
*Add support for streamed responses in the debug toolbar

return $buffer;
}, 8); // length of '</body>'

($callback)();

Choose a reason for hiding this comment

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

Suggested change
($callback)();
$callback();

$response = new StreamedResponse($this->createCallbackFromContent($content));

$m->invoke($listener, $response, Request::create('/'), ['csp_script_nonce' => 'scripto', 'csp_style_nonce' => 'stylo']);
$this->assertEquals($expected, $this->getContentFromStreamedResponse($response));

Choose a reason for hiding this comment

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

Prefer usingassertSame() wherever possible in the whole test class

$this->assertEquals($expected, $this->getContentFromStreamedResponse($response));
}

public static function getInjectToolbarTests()

Choose a reason for hiding this comment

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

Suggested change
publicstaticfunctiongetInjectToolbarTests()
publicstaticfunctionprovideInjectedToolbarHtml()

@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@alexandre-dauboisalexandre-dauboisalexandre-daubois left review comments

@stofstofAwaiting requested review from stof

Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

Web developer toolbar incompatible with streaming
5 participants
@damienfern@stof@alexandre-daubois@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp