Skip to content

Conversation

@nevans
Copy link
Collaborator

@nevans nevans commented Dec 17, 2025

Backports #587 to `v0.4-stable. From that PR:

Now that :frozen_dup is the default behavior for #responses when it's called without any arguments, a critical bug has become apparent: it was not freezing the internal responses arrays directly, rather than copies of them. Freezing these arrays will, of course, lead to further issues.

Ideally, code should be updated to use one of the other forms of #responses, since this form is less efficient and also (intentionally) incompatibile with old code that expects it to return mutable arrays. But this is still a major bug.

Fixes #581 (for 0.4), reported by @yurikoval.

Now that `:frozen_dup` is the default behavior for `#responses` when
it's called without any arguments, a critical bug has become apparent:
it was not freezing the internal responses arrays directly, rather than
copies of them.  Freezing these arrays will, of course, lead to further
issues.

Ideally, code should be updated to use one of the other forms of
`#responses`, since this form is less efficient and also (intentionally)
incompatibile with old code that expects it to return mutable arrays.
But this is still a major bug.

Fixes #581, reported by @yurikoval.
@nevans nevans added bug Something isn't working backport This issue or PR is for a stable release branch labels Dec 17, 2025
@nevans nevans merged commit 1e67a56 into v0.4-stable Dec 17, 2025
30 checks passed
@nevans nevans deleted the backport-0.4/fix-responses-frozen_dup branch December 17, 2025 18:37
@nevans nevans changed the title 🐛 Fix #responses() freezing internal arrays (backport to 0.4) 🐛 Fix config.responses_without_block = :frozen_dup (backport to 0.4) Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This issue or PR is for a stable release branch bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants