Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[HttpKernel] Fix missing Request in RequestStack for StreamedResponse #51139

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
wants to merge 1 commit into from

Conversation

DaDeather
Copy link
Contributor

Q A
Branch 6.3
Bug fix yes
New feature no
Deprecations no
Tickets Fix #46743
License MIT

Fix removing the \Symfony\Component\HttpFoundation\Request from \Symfony\Component\HttpFoundation\RequestStack when using \Symfony\Component\HttpFoundation\StreamedResponse.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.4 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@DaDeather DaDeather force-pushed the fix-httpkernel-issue-46743 branch 2 times, most recently from 8f9efc0 to ecad2c4 Compare July 28, 2023 07:51
@DaDeather DaDeather force-pushed the fix-httpkernel-issue-46743 branch from ecad2c4 to 63a8b3e Compare July 28, 2023 07:53
@OskarStark OskarStark changed the title [HttpKernel] Fix missing Request in RequestStack for StreamedResponse [HttpKernel] Fix missing Request in RequestStack for StreamedResponse Aug 2, 2023
@DaDeather
Copy link
Contributor Author

Any news on this happening? Or are any adjustments necessary?

@derrabus
Copy link
Member

Sorry that nobody has picked up your PR yet.

What I dislike about the proposed change is that the kernel is made aware of a specific response class and adds edge-case behavior to the request stack based on that.

From my PoV, it's totally reasonable that the request stack is empty at this point. If we've caused trouble for projects upgrading from Symfony 6.1, we need to find a solution, but I don't think we should pull this kind of logic into Symfony 7. 😕

@nicolas-grekas Can you take a look please?

@nicolas-grekas
Copy link
Member

Thanks for the PR and the details in the issue. I think we completely missed this consequence. It'd be fine reverting #45476, and adding also a test case that covers this situation so that we won't forget about the use case again.

@DaDeather up to submit a PR doing so?

I'm closing this one meanwhile as I agree with @derrabus, that's not the approach we should merge.

@DaDeather DaDeather deleted the fix-httpkernel-issue-46743 branch August 15, 2023 07:37
@DaDeather
Copy link
Contributor Author

Here we go: #51391

@nicolas-grekas
Copy link
Member

That's the way forward, see #51391 (comment)

nicolas-grekas added a commit that referenced this pull request Aug 16, 2023
…medResponse (Ismail Turan)

This PR was merged into the 6.3 branch.

Discussion
----------

[HttpKernel] Fix missing Request in RequestStack for StreamedResponse

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #46743
| License       | MIT
| Doc PR        | -

Similar to #51139 by `@DaDeather`, see discussion there.

Commits
-------

ca1c40e [HttpKernel] Fix missing Request in RequestStack for StreamedResponse
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