Skip to content
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

Make several logging improvements for FC #8380

Merged
merged 2 commits into from May 10, 2024

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented Apr 30, 2024

Summary

This pull request makes a few improvements to our analytics:

  1. Uses a more appropriate extraMessage in ErrorViewModel
  2. Adds pane to various events that were missing it (the pane could usually be derived from the event, but it makes the analytics harder to follow)
  3. Adds the status field to the complete event. Same logic as iOS and easier to query

(cc @kgaidis-stripe for the iOS angle)

Motivation

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

Copy link
Contributor

github-actions bot commented Apr 30, 2024

Diffuse output:

OLD: identity-example-release-base.apk (signature: V1, V2)
NEW: identity-example-release-pr.apk (signature: V1, V2)

          │          compressed          │         uncompressed         
          ├───────────┬───────────┬──────┼───────────┬───────────┬──────
 APK      │ old       │ new       │ diff │ old       │ new       │ diff 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
      dex │     2 MiB │     2 MiB │  0 B │   4.3 MiB │   4.3 MiB │  0 B 
     arsc │     1 MiB │     1 MiB │  0 B │     1 MiB │     1 MiB │  0 B 
 manifest │   2.3 KiB │   2.3 KiB │  0 B │   8.1 KiB │   8.1 KiB │  0 B 
      res │ 301.5 KiB │ 301.5 KiB │  0 B │   455 KiB │   455 KiB │  0 B 
   native │   7.3 MiB │   7.3 MiB │  0 B │  18.4 MiB │  18.4 MiB │  0 B 
    asset │   1.5 MiB │   1.5 MiB │  0 B │   1.5 MiB │   1.5 MiB │  0 B 
    other │    87 KiB │    87 KiB │ +2 B │ 161.5 KiB │ 161.5 KiB │  0 B 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
    total │  12.2 MiB │  12.2 MiB │ +2 B │  25.8 MiB │  25.8 MiB │  0 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 21686 │ 21686 │ 0 (+0 -0) 
   types │  6869 │  6869 │ 0 (+0 -0) 
 classes │  5634 │  5634 │ 0 (+0 -0) 
 methods │ 31447 │ 31447 │ 0 (+0 -0) 
  fields │ 18315 │ 18315 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  164 │  164 │  0   
 entries │ 3404 │ 3404 │  0
APK
   compressed    │  uncompressed   │                                           
──────────┬──────┼──────────┬──────┤                                           
 size     │ diff │ size     │ diff │ path                                      
──────────┼──────┼──────────┼──────┼───────────────────────────────────────────
 29.1 KiB │ +4 B │   64 KiB │  0 B │ ∆ META-INF/CERT.SF                        
    271 B │ -1 B │    120 B │  0 B │ ∆ META-INF/version-control-info.textproto 
 25.9 KiB │ -1 B │ 63.9 KiB │  0 B │ ∆ META-INF/MANIFEST.MF                    
──────────┼──────┼──────────┼──────┼───────────────────────────────────────────
 55.2 KiB │ +2 B │  128 KiB │  0 B │ (total)

@tillh-stripe tillh-stripe force-pushed the tillh/fc-logging-improvements branch 3 times, most recently from e925f37 to ced3750 Compare April 30, 2024 18:49
@@ -67,7 +67,7 @@ internal class ErrorViewModel @AssistedInject constructor(
ErrorState::payload,
onFail = { error ->
eventTracker.logError(
extraMessage = "Error linking more accounts",
extraMessage = "Error loading the error screen payload",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🥴

@tillh-stripe tillh-stripe marked this pull request as ready for review May 2, 2024 15:36
@tillh-stripe tillh-stripe requested review from a team as code owners May 2, 2024 15:36
@tillh-stripe tillh-stripe requested review from awush-stripe and carlosmuvi-stripe and removed request for awush-stripe May 2, 2024 15:36
Copy link
Collaborator

@carlosmuvi-stripe carlosmuvi-stripe left a comment

Choose a reason for hiding this comment

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

looking good! left a suggestion

Comment on lines 358 to 364
private fun computeSessionCompletionStatus(
session: FinancialConnectionsSession,
earlyTerminationCause: EarlyTerminationCause?,
closeAuthFlowError: Throwable?,
): String {
return earlyTerminationCause?.analyticsValue ?: session.completionStatus(closeAuthFlowError)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

(opinionated, feel free to ignore) - to prevent the viewmodel from growing on relatively complex pieces of logic, we can move this to a ComputeSessionCompletionStatus usecase and add some docs / tests for it : )

- Fix `extraMessage` in `ErrorViewModel`
- Report `pane` in various events
- Add `status` to complete event
- Move computation of completion status to use case
- Add unit tests for use case
@tillh-stripe tillh-stripe merged commit 95d3c9f into master May 10, 2024
12 checks passed
@tillh-stripe tillh-stripe deleted the tillh/fc-logging-improvements branch May 10, 2024 16:49
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.

None yet

2 participants