Skip to content

Serialize Active Record errored elements#1494

Merged
adrianna-chang-shopify merged 2 commits into
mainfrom
ac-error-reporter-edge-fix
Jun 3, 2026
Merged

Serialize Active Record errored elements#1494
adrianna-chang-shopify merged 2 commits into
mainfrom
ac-error-reporter-edge-fix

Conversation

@adrianna-chang-shopify
Copy link
Copy Markdown
Contributor

@adrianna-chang-shopify adrianna-chang-shopify commented Jun 3, 2026

Rails now deep-dups error report context for each subscriber, so passing an Active Record instance as errored_element can clear its primary key before subscribers serialize it.

This PR serialize the Active Record errored_element values before calling Rails.error.report, while preserving non-Active Record values and the legacy handler path.

Rails change: rails/rails@d9e293e

I'm opting not to branch based on the AR version (ie. deprecate calling the error reporter with the full AR object and branch on the new codepath), but we can go that route if preferred.

Rails now deep-dups error report context for each subscriber, so passing an Active Record instance as errored_element can clear its primary key before subscribers serialize it.

Serialize Active Record errored_element values before calling Rails.error.report while preserving non-Active Record values and the legacy error_handler path.

Rails change: rails/rails@d9e293e
@adrianna-chang-shopify adrianna-chang-shopify requested a review from a team June 3, 2026 14:13
@adrianna-chang-shopify adrianna-chang-shopify merged commit 6d6e4c0 into main Jun 3, 2026
37 checks passed
@adrianna-chang-shopify adrianna-chang-shopify deleted the ac-error-reporter-edge-fix branch June 3, 2026 14:31
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