Skip to content

[WebProfilerBundle] Show EventSource requests in debug toolbar #61311

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 7.4
Choose a base branch
from

Conversation

valtzu
Copy link
Contributor

@valtzu valtzu commented Aug 3, 2025

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues Related to #57288
License MIT

Show requests originated from js EventSource (Server-Sent Events) in the web debug toolbar.

By using custom event type we should be able to avoid interfering with any app logic.

@valtzu
Copy link
Contributor Author

valtzu commented Aug 3, 2025

Some screenshots below

In progress

image

Finished successfully

image

Exception thrown while streaming

image

@valtzu valtzu changed the title [WebProfilerBundle] Show EventStreams in debug toolbar [WebProfilerBundle] Show Server-Sent Events in debug toolbar Aug 3, 2025
@valtzu valtzu force-pushed the web-profiler-event-stream branch from ef33ff6 to 3d3cd2d Compare August 3, 2025 13:48
@valtzu valtzu changed the title [WebProfilerBundle] Show Server-Sent Events in debug toolbar [WebProfilerBundle] Show EventSource requests in debug toolbar Aug 3, 2025
@valtzu valtzu force-pushed the web-profiler-event-stream branch from 3d3cd2d to 339be35 Compare August 4, 2025 17:22
@valtzu valtzu force-pushed the web-profiler-event-stream branch from 339be35 to a4ed7af Compare August 4, 2025 17:23
@chalasr
Copy link
Member

chalasr commented Aug 4, 2025

👍 Good idea

$response->setCallback(static function () use ($callback, $response) {
$response->sendEvent(new ServerEvent(
[
$response->headers->get('X-Debug-Token') ?? '',
Copy link
Member

Choose a reason for hiding this comment

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

this data is static, so why repeat it for every message?

Copy link
Contributor Author

@valtzu valtzu Aug 5, 2025

Choose a reason for hiding this comment

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

Hmm what do you mean? It's only included once per stream/request: $callback() outputs all the messages user yielded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy