Skip to content

Conversation

@jonathanhefner
Copy link
Member

Prior to this commit, config.load_defaults 7.1 would cause old messages (or messages from older apps) to become unreadable, and developers were encouraged to manually set
config.active_support.message_serializer = :json_allow_marshal in order to prevent this.

This commit changes the default message serializer set by config.load_defaults 7.1 from :json to :json_allow_marshal so that upgraded apps can continue to read old messages without additional configuration.

The intention is to eventually change the default to :json (with no Marshal fallback) in Rails 7.2, after some time has passed with apps generating JSON-serialized messages.

Apps can opt in to JSON-only serialization before Rails 7.2 by manually setting config.active_support.message_serializer = :json.

Fixes #48118.

Prior to this commit, `config.load_defaults 7.1` would cause old
messages (or messages from older apps) to become unreadable, and
developers were encouraged to manually set
`config.active_support.message_serializer = :json_allow_marshal` in
order to prevent this.

This commit changes the default message serializer set by
`config.load_defaults 7.1` from `:json` to `:json_allow_marshal` so that
upgraded apps can continue to read old messages without additional
configuration.

The intention is to eventually change the default to `:json` (with no
`Marshal` fallback) in Rails 7.2, after some time has passed with apps
generating JSON-serialized messages.

Apps can opt in to JSON-only serialization before Rails 7.2 by manually
setting `config.active_support.message_serializer = :json`.

Fixes rails#48118.
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.

ActiveSupport::MessageEncryptor migration path to 7.1 defaults

2 participants