Skip to content

[VarDumper] inline dumps break response and request missing from profiler #17043

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

Closed
teohhanhui opened this issue Dec 17, 2015 · 7 comments
Closed

Comments

@teohhanhui
Copy link
Contributor

Continuing the discussion from #14608...

A quick recap of the situation so far:
#14478 introduced inline dumps. This breaks the response when the response content type is not plain text or HTML (e.g. JSON).
#14609 alleviated the probem somewhat, by suppressing the inline dumps when the request can be detected as XHR (X-Requested-With header) or CORS (Origin header).
#14640 added the debug.dump_destination configuration option, which made it possible to unconditionally suppress inline dumps (usually per environment). This is not ideal as it also affects the CLI and HTML output.

There is also the greater issue that the request becomes entirely missing from the profiler when an inline dump is done inappropriately... I'd argue that this should never be allowed to happen, regardless of what we choose to do about such inappropriate inline dumps.

Suggestions:

  • Perhaps add an argument to dump to suppress inline dump.
@teohhanhui
Copy link
Contributor Author

ping @nicolas-grekas

@nicolas-grekas
Copy link
Member

I'm sorry about that, it's maybe to early in the morning for me, but what you describe is correct, which means there is no issue...
For the "greater issue", I'm not sure to understand. What means "inappropriately"?
Adding an arg to dump() is not possible because the function already handles several args. But anyway, can you first describe your use case or your expectations?

@teohhanhui
Copy link
Contributor Author

what you describe is correct, which means there is no issue...

There is an issue because not all inline dumps are properly suppressed when they should be / can be suppressed when we want them to be.

For the "greater issue", I'm not sure to understand.

When an inline dump (plain text) is done in a JSON response (for example), an entry for the request cannot be found in the Symfony web profiler.

What means "inappropriately"?

Plain text inline dump breaks the response. That's what I mean by "inappropriately".

Adding an arg to dump() is not possible because the function already handles several args.

Noted. Perhaps we can think of other ways then...

@HeahDude
Copy link
Contributor

HeahDude commented Jul 8, 2016

Is there anything we can/should do here? @nicolas-grekas says this is an expected behavior.

Should we better document it or close as "won't fix"?

@nicolas-grekas
Copy link
Member

When an inline dump (plain text) is done in a JSON response (for example), an entry for the request cannot be found in the Symfony web profiler.

Just to revive this issue, could you please provide a reproducer, starting with a 3.3 standard edition?

@jakzal
Copy link
Contributor

jakzal commented Oct 25, 2017

ping @teohhanhui

@xabbuh
Copy link
Member

xabbuh commented Nov 13, 2017

I am going to close here for now due to the lack of feedback. Please let us know when you have more information and we can consider to reopen.

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

No branches or pull requests

7 participants