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

LG-14492 Accept a string in the ipp helper scrub method #11269

Merged

Conversation

jennyverdeyen
Copy link
Member

🎫 Ticket

Link to the relevant ticket:
LG-14492

🛠 Summary of changes

Errors in NewRelic revealed that some USPS exceptions include a response body with a String instead of a hash, but we were assuming the body would be a hash in our method to scrub it for sponsor ID, causing the error undefined method 'with_indifferent_access' for instance of a String.

This accepts a String and still ensures that it is scrubbed of a sponsor ID.

📜 Testing Plan

  • Automated tests pass

changelog: Internal, In-person proofing, accept String when scrubbing sponsor id with ipp helper
@jennyverdeyen jennyverdeyen requested review from a team and KeithNava September 19, 2024 20:57
body = body.with_indifferent_access
body[:responseMessage] = scrub_message(body[:responseMessage])
body
if body.is_a?(String)
Copy link
Contributor

Choose a reason for hiding this comment

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

[non-blocking] I would be curious when a String would come from USPS. I don't remember seeing anything explicit about it in the API docs 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

I am too. 🤔 That's the only thing lingering in my head for this as well, and I wasn't sure if it warranted more concern. But I wasn't able to replicate it based on the user flows I dug up leading to this error, so I couldn't determine if it was something we aren't anticipating on our end. Either way I figure it can just be scrubbed.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jennyverdeyen If you want, we could email USPS or ask about it at one of our technical sync meetings. We'd probably get a response sooner if we reach out via email.

@jennyverdeyen jennyverdeyen merged commit e48e087 into main Sep 24, 2024
2 checks passed
@jennyverdeyen jennyverdeyen deleted the jverdeyen/LG-14492-ipp-sponsor-id-scrubber-accepts-string branch September 24, 2024 19:05
AShukla-GSA pushed a commit that referenced this pull request Sep 27, 2024
* LG-14492 Accept a string in the ipp helper scrub method

changelog: Internal, In-person proofing, accept String when scrubbing sponsor id with ipp helper
AShukla-GSA pushed a commit that referenced this pull request Sep 30, 2024
* LG-14492 Accept a string in the ipp helper scrub method

changelog: Internal, In-person proofing, accept String when scrubbing sponsor id with ipp helper
MrNagoo pushed a commit that referenced this pull request Oct 3, 2024
* LG-14492 Accept a string in the ipp helper scrub method

changelog: Internal, In-person proofing, accept String when scrubbing sponsor id with ipp helper
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.

4 participants