MBL-2952: Telemetry + small improvements on Login flow + analytics adjustments#2467
MBL-2952: Telemetry + small improvements on Login flow + analytics adjustments#2467
Conversation
- Added re-direction processing on OnCreate - Added on OAuthWebview systemBarsPadding + some extra flags just in case
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2467 +/- ##
============================================
- Coverage 64.92% 64.91% -0.01%
- Complexity 2411 2413 +2
============================================
Files 380 380
Lines 28964 28977 +13
Branches 4170 4171 +1
============================================
+ Hits 18804 18811 +7
- Misses 7887 7894 +7
+ Partials 2273 2272 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| codeVerifier = null | ||
| } | ||
| } | ||
| } catch (e: OAuthException) { |
There was a problem hiding this comment.
Do we want to only catch OAuthException here and below? Seems like processThrowable() would call errorAction to wrap any exception in an OAuthException and send it to Firebase.
There was a problem hiding this comment.
My bad, this should not have been comited/pushed, was forcing around Firebase reporting capabilities 🤦♀️
|
|
||
| oAuthViewModel.provideErrorAction { cause -> | ||
| FirebaseCrashlytics.getInstance().recordException(OAuthException(cause)) | ||
| } |
There was a problem hiding this comment.
OAuthExceptio only purpose is to unify reports on Firebase (aiming to single source non-fatal report), using it to wrap all Throwable errors that might happen

📲 What
Scenario 1: redirection processing on
OnCreate.📥 Despite not being able to reproduce at all this scenario, by looking at the documentation there is the small chance the 'LoginToutActivity' was killed by the OS. Even if we use
android:launchMode="singleTop", if the system killed the Activity to reclaim memory while the user was in the ChromeTab, the redirect will recreate 'LoginToutActivity' from scratch, triggering onCreate instead ofonNewInten`. This specific scenario will look like a loop to the user.Scenario 2: Added on OAuthWebview systemBarsPadding + some extra flags for javascript + dom storage.
Another piece tried/tested was eliminating Google Chrome completely, therefore no ChromeTab involved. In this scenarios a WebView (in OAuthWebViewActivity) will handle the login flow. Users triggering this scenario will be those user using browser not Chromium based (Mozilla Firefox, Opera mini, Tor ...). This was tested once more successfully but adjusted the UI to respect systemBars + allowed the webview some more capabilities for javascript and dome based storage just to play it safe, we have tried this route several times being able to log in successfully but cannot try every single browser out there.
**Telemetry: Added on OAuthViewModel redundant try/catch blokes + sending any potential error to Firebase as Non-fatal.
attached imaged of how it will look like in Firabase:
Some additional information about analytic events. On android we had misplaced a CTA button clicked (it was only trigged when user successfully logged in).
Now the sequence of Analytic events triggered are
1 - PageViewed with "context_page": "log_in_sign_up" , triggered when LoginToutActivity is presented.
2 - CTA Clicked with "context_cta": "log_in_initiate" , triggered when user presses login button this button opens the web experience (in a ChromeTab/Webview). (This is the one originally misplaced)
3- When ChromeTab is triggered & 4 - When user is redirected back to KSApp.
5- Identify call when user successfully logged in
📥 Note additionally every single one of those analytic events is marked with a trait
anonymousIdbefore and after the user logs in. This specific information should me helpful when putting together funnels"traits": {
"anonymousId": "11aec7dc-d038-419e-95e4-7db9c25e8ec6"
},
🤔 Why
We have been having user reviews complaining about several issues with login, in both platforms iOS + Android, as we have been completely unable to reproduce in any platform adding more telemetry. Same approach has been taken on the backend side -> https://github.com/kickstarter/kickstarter/pull/33354 which results once Pr released will be displayed in https://app.datadoghq.com/dashboard/2xu-k3f-zki/kickstarter---logins?fromUser=false&offset=1&refresh_mode=yearly&from_ts=1737934143888&to_ts=1769470143887&live=true.
In case more information is required pass by https://kickstarter.slack.com/archives/C0A723PENDT
| | |
📋 QA
To test Scenario 1:
OnCreateroute comment out in the manifest line 135To test Scenario 2:
To test analytics:
Story 📖
MBL-2952