Skip to content

Omit errors from serialized form response if details present#11846

Merged
aduth merged 4 commits intomainfrom
aduth-omit-errors-if-details
Feb 6, 2025
Merged

Omit errors from serialized form response if details present#11846
aduth merged 4 commits intomainfrom
aduth-omit-errors-if-details

Conversation

@aduth
Copy link
Copy Markdown
Contributor

@aduth aduth commented Feb 6, 2025

🛠 Summary of changes

Updates FormResponse#to_h to avoid including errors in the serialized hash if error_details is present.

This is a continuation (cleanup) of #11810, which effectively omitted errors from analytics logging, but continued to assign the value as nil. The changes here avoid assigning the value altogether.

Related: #11810 (comment)

📜 Testing Plan

Verify build passes.

aduth added 4 commits February 6, 2025 08:50
changelog: Internal, Analytics, Omit errors from serialized form response if details present
No longer expecting errors keys in these
def to_h
hash = { success: success }
hash[:errors] = (!defined?(@error_details) && errors).presence if !serialize_error_details_only?
hash[:errors] = errors.presence if !defined?(@error_details) && !serialize_error_details_only?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@aduth aduth merged commit 0cb8aa3 into main Feb 6, 2025
@aduth aduth deleted the aduth-omit-errors-if-details branch February 6, 2025 20:10
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.

2 participants