Skip to content
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

Call to_hash On inertia_errors for Session Serialization #143

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

BenMorganMY
Copy link
Contributor

As one can see in the screenshot below, if ActiveModel::Errors is passed as the error object, it will be stored in the session. If your cookie_serializer is :json, :marshal, or :hybrid this will work fine. However, Rails now uses :message_pack and ActiveModel::Errors does not respond to to_msgpack. This ensures that errors being passed are turned into a hash.

Screenshot 2024-10-25 at 2 40 59 PM

@davidwessman
Copy link

I literally ran into this error last week, so would really like this change! 🚀

@bknoles
Copy link
Collaborator

bknoles commented Oct 30, 2024

image

If I'm reading this table correctly, you've listed all the possible options, and all should be working after this change, so looks safe to merge it in!

I'll update here once we get a release out with the change.

@bknoles bknoles merged commit bdf9a2d into inertiajs:master Oct 30, 2024
9 checks passed
@BenMorganMY BenMorganMY deleted the fix-inertia-errors branch October 30, 2024 21:39
@bknoles
Copy link
Collaborator

bknoles commented Nov 2, 2024

Released in 3.4.0!

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.

3 participants