Skip to content

STR-357 :: If fingerprint analytics fails, continue anyways#99

Merged
alcalawil merged 11 commits intodevelopfrom
fix/wil/str-357
Jan 31, 2023
Merged

STR-357 :: If fingerprint analytics fails, continue anyways#99
alcalawil merged 11 commits intodevelopfrom
fix/wil/str-357

Conversation

@alcalawil
Copy link
Copy Markdown
Contributor

@alcalawil alcalawil commented Jan 25, 2023

How to test:

  1. run api, sdk and iframe on branch fix/wil/str-357
  2. on the infra repo run docker-compose up redis db string-api --build
  3. From Insomnia, create a new user with mocked visitor data
  4. open the iframe.
  5. Authorize the same user from the iframe
  6. Verify email
  7. Device verification should be working as usual

image

  1. In the SDK's .env file, set a wrong value in the fingerprint api key var VITE_ANALYTICS_LIB_PK=123
  2. Authorize wallet again
  3. You shoul see the Verify Device screen
  4. Verify Device
  5. Log in again
  6. You should see the verification device screen on every login (when fingerprint is not available)

ocasta181
ocasta181 previously approved these changes Jan 31, 2023
@saito-sv saito-sv self-requested a review January 31, 2023 20:08
Copy link
Copy Markdown

@saito-sv saito-sv left a comment

Choose a reason for hiding this comment

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

LGTM

@auroter auroter self-requested a review January 31, 2023 23:01
Copy link
Copy Markdown
Contributor

@auroter auroter left a comment

Choose a reason for hiding this comment

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

I left some optional suggestions. If you decide to commit them, let me know and I'll re-approve.

return Unprocessable(c)
}
if err != nil {
if strings.Contains(err.Error(), "unknown device") {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This way of checking the error is fine, but we can also check the top level error like so:

Suggested change
if strings.Contains(err.Error(), "unknown device") {
if err != nil && errors.Cause(err).Error() == "unknown device" {

Which you can see on api/handler/quotes.go:41

if strings.Contains(err.Error(), "unknown device") {
return Unprocessable(c)
}
if strings.Contains(err.Error(), "invalid email") {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same idea here as above. You could also say:

Suggested change
if strings.Contains(err.Error(), "invalid email") {
if errors.Cause(err).Error() == "invalid email" {

@alcalawil alcalawil merged commit 1ce5015 into develop Jan 31, 2023
@alcalawil alcalawil deleted the fix/wil/str-357 branch January 31, 2023 23:42
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