-
Notifications
You must be signed in to change notification settings - Fork 166
Send Selfie Errors from BE to FE #9941
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
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
0183bdd
Refactor in preparation for allowing more errors
charleyf b36be98
Draft in error reporting
charleyf 02a46a8
Fill in selfie error generator
charleyf dada67c
Add comments
charleyf 1396c89
Add comments to mark broken tests
charleyf 165a36d
Fix comment
charleyf d2dcb1e
Fix mixed up error names
charleyf ee025ce
Use a case (switch) statement instead of ifs
charleyf 5042766
Revise comments
charleyf cea16b8
Add comment to mark message
charleyf 313f1d1
Merge branch 'main' into charley/lg-12157-send-selfie-fail-info-to-fe
charleyf 23ff4d9
Fix missing `end`
charleyf 20934da
Add missing error keys
charleyf 69a2ced
User Facing Improvements, In-Person Proofing, add error messages behi…
charleyf 005821d
changelog: User Facing Improvements, In-Person Proofing, add error me…
charleyf e061f6c
Draft in selfie error check fields
charleyf 08a2bdc
Update the two selfie error booleans
charleyf bd061f4
Add tests for the concern
charleyf 815802d
Re-add accidentally deleted return value
charleyf d153145
Fix upload presenter tests
charleyf 6a3ef4f
Get tests passing
charleyf 343a2db
Fix string for success error message
charleyf 05f274f
Update presenter to only send selfie fail info if it's relevant
charleyf 4b7e8cd
Merge branch 'main' into charley/lg-12157-send-selfie-fail-info-to-fe
charleyf f3dc0b2
Fix test with new response params
charleyf eeca656
Fix selfie concern tests
charleyf 0870619
Fix acuant api tests
charleyf 453cdc4
Fix tests
charleyf b86e5f8
Centralize facematcherror text comparisons into the concern
charleyf a563e82
Fix testing problem
charleyf 30aab53
Use `blank` instead of `empty`
charleyf 94aa1d6
Fix two bugs that compounded each other
charleyf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| module DocAuth | ||
| module SelfieConcern | ||
| extend ActiveSupport::Concern | ||
| def selfie_live? | ||
| portait_error = get_portrait_error(portrait_match_results) | ||
charleyf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return true if portait_error.nil? || portait_error.blank? | ||
| return error_is_not_live(portait_error) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit, redundant return, and there are few methods down there too. |
||
| end | ||
|
|
||
| def selfie_quality_good? | ||
| portait_error = get_portrait_error(portrait_match_results) | ||
| return true if portait_error.nil? || portait_error.blank? | ||
| return error_is_poor_quality(portait_error) | ||
| end | ||
|
|
||
| def error_is_success(error_message) | ||
| return error_message != ERROR_TEXTS[:success] | ||
| end | ||
|
|
||
| def error_is_not_live(error_message) | ||
| return error_message != ERROR_TEXTS[:not_live] | ||
| end | ||
|
|
||
| def error_is_poor_quality(error_message) | ||
| return error_message != ERROR_TEXTS[:poor_quality] | ||
| end | ||
|
|
||
| private | ||
|
|
||
| ERROR_TEXTS = { | ||
| success: 'Successful. Liveness: Live', | ||
| not_live: 'Liveness: NotLive', | ||
| poor_quality: 'Liveness: PoorQuality', | ||
| } | ||
|
|
||
| # @param [Object] portrait_match_results trueid portait match info | ||
| def get_portrait_error(portrait_match_results) | ||
| portrait_match_results&.with_indifferent_access&.dig(:FaceErrorMessage) | ||
| end | ||
| end | ||
| end | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.