Skip to content

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

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 11 commits into from
Jan 31, 2023

Conversation

alcalawil
Copy link
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

@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
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.

if err != nil {
if strings.Contains(err.Error(), "unknown device") {
Copy link
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
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