You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would either expect that the array that is returned from I18n.fallbacks is a dup of the original one so that I can mutate it without poisoning future requests, or that the array that is returned is frozen so that it can't be mutated.
I personally would prefer the frozen array so that we don't incur the overhead of duplicating the array on each request if we probably aren't going to mutate it.
I can make a PR once we have decided which behaviour we prefer.
What actually happened
The array that is returned is mutable and if I mutate it then the mutated array is returned for future requests.
Versions of i18n, rails, and anything else you think is necessary
i18n version 1.14.7
rails 7.2.2.1
ruby 3.4.2
Bonus points for providing an application or a small code example which reproduces the issue.
Thanks! ❤️
The text was updated successfully, but these errors were encountered:
What I tried to do
What I expected to happen
I would either expect that the array that is returned from
I18n.fallbacks
is adup
of the original one so that I can mutate it without poisoning future requests, or that the array that is returned is frozen so that it can't be mutated.I personally would prefer the frozen array so that we don't incur the overhead of duplicating the array on each request if we probably aren't going to mutate it.
I can make a PR once we have decided which behaviour we prefer.
What actually happened
The array that is returned is mutable and if I mutate it then the mutated array is returned for future requests.
Versions of i18n, rails, and anything else you think is necessary
i18n version 1.14.7
rails 7.2.2.1
ruby 3.4.2
Bonus points for providing an application or a small code example which reproduces the issue.
Thanks! ❤️
The text was updated successfully, but these errors were encountered: