GoodDollar / GoodProtocolUI

UI for the GoodProtocol smart contracts
https://good-swap.vercel.app
GNU General Public License v3.0
7 stars 12 forks source link

(Bug) FV failing on mobile with not enough information #466

Closed sirpy closed 12 months ago

sirpy commented 1 year ago

The following error happens only mobile https://gooddollar.sentry.io/issues/2174107180/events/?alert_rule_id=1208119&alert_type=issue&notification_uuid=175cebbc-0586-4917-ab58-015fba983166&project=1829798&referrer=slack

The error message is: Session could not be completed due to an unexpected issue during the network request.

Note When looking at the server logs for some of these users there are no requests besides to "check face disposal sate" So it looks like the error might be somewhere between that call and the next expected fv server call. (session token?license?)

There are a few things to investigate and fix here:

vldkhh commented 1 year ago

@sirpy @L03TJ3 @johnsmith-gooddollar Version 2.24.3 (4706)

Video:

[Uploading... 6438ACE2-5459-45BF-9A40-AE7B915ED6B9.MP4]

Logs: FV error.txt

johnsmith-gooddollar commented 1 year ago

@sirpy @vldkhh

Yes the same error message was hard-coded in 2 places and there was no option to diversify it I've adjusted error handling, now it's 2 messages about server error on session start / end I cannot return json response, so now I return error message we receive from GoodServer

According to the behaviour it's an error during session token retrieve. It may be caused of 2 reasons a) outdated SDK - I've updated them b) wrong encryption key ?

I hotfixed fv package and app, let's see which errors we're receiving now and which is server message.

UPD: I've checked Heroku logs and cannot find any generating enrollment session token failed, so it's not a server issue and maybe not a session token issue at all. needs detailed investigation after new Android version will go live

L03TJ3 commented 1 year ago

@johnsmith-gooddollar @sirpy Just tested prod apk, the same issue persists.

once clicking on verify (on the oval screen with the lady face), it just immediately jumps to 'something went wrong'

@vldkhh your video failed to upload

johnsmith-gooddollar commented 1 year ago
  1. after logging been updated I saw the error is related to the session start (retrieve a session token) and the message is org.json.JSONException: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject.

that means we got some html page while we supposed to receive JSON. This may happen when server returns plain or html HTTP error page.

  1. in the log tail I found

Private Zenhub Image

testing such double slashed urls I found they really produced 404 'page not found' printed as html

Private Zenhub Image

  1. why this happens ? we have unbtrailed server urls set in env.xxx but in Vercel they're set with trailing slash. Private Zenhub Image

pulling Vercel env overwrites the original value

Why it worked for some time ? No exact answer, most probably Heroku was tolerant for such //-started urls, then they fixed it.

  1. I've hotfixed issue with removing trailing slash just before we pass server url to the Java module. https://github.com/GoodDollar/ReactNativeFaceTec/commit/eb83b33883f3893eba1e6070288256644c387c00 https://github.com/GoodDollar/GoodDAPP/commit/30f078c15068abfd626f85b05e0a76f3dfe2ca23

I also suggest to ensure REACT_APP_SERVER_URL in all places is set without trailing slash and fix if need @L03TJ3

vldkhh commented 1 year ago

@johnsmith-gooddollar is it new design for mobile or its a bug? Private Zenhub Image

johnsmith-gooddollar commented 12 months ago

It’s a feature of facetec Total blank if low lights Total black if too bright

vldkhh commented 12 months ago

verified on prod