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

Rails 7.1 Incompatibility: ActionView::Helpers::FormBuilder #199

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kbruccoleri
Copy link

Due to Rails monkey patching the Object#to_json method, it is possible for an unassuming object to call the method and trigger a <SystemStackError: stack level too deep> error.

https://github.com/rails/rails/blob/v7.1.3.2/activesupport/lib/active_support/core_ext/object/json.rb#L63

We discovered a case where this was caused by an instance of ActionView::Helpers::FormBuilder. We extended MetaRequest::Event#not_encodable? to exclude this class and prevent the recursion.

Due to Rails monkey patching the Object#to_json method, it is possible for an unassuming object to call the method and trigger a <SystemStackError: stack level too deep> error.

https://github.com/rails/rails/blob/v7.1.3.2/activesupport/lib/active_support/core_ext/object/json.rb#L63

We discovered a case where this was caused by an instance of ActionView::Helpers::FormBuilder. We extended MetaRequest::Event#not_encodable? to exclude this class and prevent the recursion.
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.

None yet

1 participant