-
Notifications
You must be signed in to change notification settings - Fork 120
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
LG-14492 Accept a string in the ipp helper scrub method #11269
Conversation
changelog: Internal, In-person proofing, accept String when scrubbing sponsor id with ipp helper
body = body.with_indifferent_access | ||
body[:responseMessage] = scrub_message(body[:responseMessage]) | ||
body | ||
if body.is_a?(String) |
There was a problem hiding this comment.
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 🤔
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
* 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
* 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
* 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
🎫 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