Skip to content

Ensure streaming response body is closed by Rack::MockResponse.#2423

Merged
ioquatix merged 1 commit intomainfrom
mock_response-streaming-response-body-close
Feb 5, 2026
Merged

Ensure streaming response body is closed by Rack::MockResponse.#2423
ioquatix merged 1 commit intomainfrom
mock_response-streaming-response-body-close

Conversation

@ioquatix
Copy link
Copy Markdown
Member

@ioquatix ioquatix commented Feb 4, 2026

Fixes #2422.

As this is a bug fix, can we back port it to 3.2 at least? 3.1 might be nice too. We'd need to include the changes introduced by #2420.

Copy link
Copy Markdown
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

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

Support for streamable bodies was only added in master, it's not in 3.2. I would classify it as a feature, not a bug fix, because MockResponse#body was not designed to support streamable bodies. So I wouldn't backport this to 3.2 or 3.1.

@ioquatix
Copy link
Copy Markdown
Member Author

ioquatix commented Feb 4, 2026

Support for streamable bodies was only added in master, it's not in 3.2

While I understand this point, MockResponse#body basically just doesn't work for some subset of valid Rack responses which to me seems like a bug.

@ioquatix ioquatix force-pushed the mock_response-streaming-response-body-close branch from d83a525 to d24a834 Compare February 4, 2026 23:04
@ioquatix ioquatix requested a review from jeremyevans February 4, 2026 23:04
@ioquatix ioquatix merged commit 550de04 into main Feb 5, 2026
31 checks passed
@ioquatix ioquatix deleted the mock_response-streaming-response-body-close branch February 5, 2026 00:25
ioquatix added a commit that referenced this pull request Feb 12, 2026
ioquatix pushed a commit that referenced this pull request Feb 12, 2026
- Ensure streaming response body is closed by `Rack::MockResponse`. (#2423)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rack::Events on_finish callback is not called in a Rails ActionDispatch::IntegrationTest with a streaming body

2 participants