-
Notifications
You must be signed in to change notification settings - Fork 115
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-14790 handle network failures for socure #11430
lg-14790 handle network failures for socure #11430
Conversation
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.
LGTM
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.
- can we add to DocAuth::Socure::Request
def handle_connection_error
raise NotImplementedError
end
- DocmentRequest.fetch is expecting a hash, so it seems like DocumentRequest#handle_connection_error should return a hash
- similar to LN request, it looks like DocAuth::Socure::Request#handle_http_response should return handle_connection_error
- can we add testing for the Socure standard and hybrid document capture controllers
…ating service and controller rspec tests
the caller of DocvResultRequest#fetch is currently receiving a hash, while it is expecting to receive a DocvResultResponse. it looks like we need to override Socure::Request#handle_invalid_response by creating DocvResultResponse#handle_invalid_response that returns a call to handle_connection_error(DocvResultResponse). I noticed that the http response body (received from Socure) can be blank dependent upon the type of error (ie: invalid API key -- see screenshot). Otherwise, the API doc shows the body for other types of errors (400, 401) which can help us to determine how to process the http response when creating the DocvResultResponse. |
It'd be helpful to add some deeper testing (particularly in our controllers) to catch and protect against these types of scenarios 🤔 |
spec/controllers/idv/hybrid_mobile/socure/document_capture_controller_spec.rb
Outdated
Show resolved
Hide resolved
spec/controllers/idv/hybrid_mobile/socure/document_capture_controller_spec.rb
Outdated
Show resolved
Hide resolved
spec/controllers/idv/socure/document_capture_controller_spec.rb
Outdated
Show resolved
Hide resolved
spec/controllers/idv/socure/document_capture_controller_spec.rb
Outdated
Show resolved
Hide resolved
spec/controllers/idv/socure/document_capture_controller_spec.rb
Outdated
Show resolved
Hide resolved
spec/controllers/idv/socure/document_capture_controller_spec.rb
Outdated
Show resolved
Hide resolved
spec/controllers/idv/socure/document_capture_controller_spec.rb
Outdated
Show resolved
Hide resolved
…he top request level
spec/controllers/idv/hybrid_mobile/socure/document_capture_controller_spec.rb
Outdated
Show resolved
Hide resolved
…nce try again functionality is implemented
spec/controllers/idv/hybrid_mobile/socure/document_capture_controller_spec.rb
Outdated
Show resolved
Hide resolved
spec/controllers/idv/socure/document_capture_controller_spec.rb
Outdated
Show resolved
Hide resolved
spec/services/doc_auth/socure/requests/docv_result_request_spec.rb
Outdated
Show resolved
Hide resolved
spec/services/doc_auth/socure/requests/docv_result_request_spec.rb
Outdated
Show resolved
Hide resolved
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.
LGTM ... thanks @AShukla-GSA 👍🏿
This reverts commit 4e8a421.
🎫 Ticket
Link to the relevant ticket:
LG-14790
🛠 Summary of changes
Implemented handle_connection_error for socure requests