Skip to content

LG-10889: image metric error#9426

Merged
dawei-nava merged 9 commits intomainfrom
dwang/LG-10889-image-metric-error
Oct 25, 2023
Merged

LG-10889: image metric error#9426
dawei-nava merged 9 commits intomainfrom
dwang/LG-10889-image-metric-error

Conversation

@dawei-nava
Copy link
Contributor

@dawei-nava dawei-nava commented Oct 20, 2023

🎫 Ticket

LG-10889: Fix bug where user does not see inline errors when Acuant AssureID service encountered errors indicated by http status code 438, 439, 440.

🛠 Summary of changes

Add inline error message for Acuant response status code specific to 438, 439 and 440.

📜 Testing Plan

Testing in dev.

Http status 438:

  • Step 1 Enter doc auth flow
  • Step 2 Upload test yml file to both front and back
http_status:
  back:  438
  • Step 3 Verify specific inline error for back image

Http status 439:

  • Step 1 Enter doc auth flow
  • Step 2 Upload test yml file to both front and back
http_status:
  front:  439
  • Step 3 Verify specific inline error for front image

Http status 440:

  • Step 1 Enter doc auth flow
  • Step 2 Upload test yml file to both front and back
http_status:
  front:  440
  • Step 3 Verify specific inline error for front image

In higher environment:

This is Acuant specific, so testing is not straight forward, basic testing can be done with images not satisfying size requirement which is 2025 x 1275 pixels.

👀 Screenshots

Http status 438: image load failure

English:

438-inline-En

Spanish:
438-inline-Es

French:
438-inline-Fr

Http status 439: pixel depth

English:

439-inline-En

Spanish:
439-inline-Es

French:
439-inline-Fr

Http status 440: image size

English:
440-inline-En

Spanish:

440-inline-Es

French:

440-inline-Fr

…e Acuant document said it's a possible outcome.
… the translated message turns out to be default. Seems caused by some library bug due to value collision of the hash.
changelog: User-Facing Improvements, Document Capturing, Improve image related inline error messages.
@dawei-nava dawei-nava marked this pull request as ready for review October 22, 2023 17:38
@dawei-nava dawei-nava requested review from a team, charleyf, daviddsilvanava and eileen-nava and removed request for a team October 23, 2023 13:18
Copy link

@daviddsilvanava daviddsilvanava left a comment

Choose a reason for hiding this comment

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

Deferring to Kelli, but screenshots looked good to me

@dawei-nava
Copy link
Contributor Author

@kellular , attached screenshots.

Copy link

@kellular kellular left a comment

Choose a reason for hiding this comment

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

This looks good to me!

Copy link
Contributor

@eileen-nava eileen-nava left a comment

Choose a reason for hiding this comment

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

Approved! 👍🏻

end

def errors_from_http_status(status)
case status
Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏻


error_keys.each do |category|
response.errors[category]&.map! do |plain_error|
cat_errors = response.errors[category]
Copy link
Contributor

Choose a reason for hiding this comment

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

I read the commit message, and that's an interesting bug! Glad you figured out a way to fix it. This looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@eileen-nava , yeah very similar to the one we have with hash keys collision. Here I have some test case failed and some worked.

action
expect(response.status).to eq(400)
expect(json[:success]).to eq(false)
expect(json[:remaining_attempts]).to be_a_kind_of(Numeric)
Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏻

end
end

shared_examples_for 'inline error for 4xx status shown' do |status|
Copy link
Contributor

Choose a reason for hiding this comment

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

Snaps for shared_examples_for 👍🏻

@dawei-nava dawei-nava merged commit c1984c2 into main Oct 25, 2023
@dawei-nava dawei-nava deleted the dwang/LG-10889-image-metric-error branch October 25, 2023 15:15
@mdiarra3 mdiarra3 mentioned this pull request Oct 26, 2023
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