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

Add elements/session analytics for CustomerSession on CustomerSheet #9395

Merged

Conversation

samer-stripe
Copy link
Collaborator

Summary

Add elements/session analytics for CustomerSession on CustomerSheet

Motivation

Track success & failed loads for elements/session on CustomerSheet with CustomerSession.

Testing

  • Added tests
  • Modified tests
  • Manually verified

@@ -288,6 +324,7 @@ class DefaultCustomerSessionElementsSessionManagerTest {
)

assertThat(errorReporter.getLoggedErrors()).containsExactly(
ErrorReporter.SuccessEvent.CUSTOMER_SHEET_CUSTOMER_SESSION_ELEMENTS_SESSION_LOAD_SUCCESS.eventName,
ErrorReporter
.UnexpectedErrorEvent
.CUSTOMER_SESSION_ON_CUSTOMER_SHEET_ELEMENTS_SESSION_NO_CUSTOMER_FIELD
Copy link
Collaborator Author

@samer-stripe samer-stripe Oct 3, 2024

Choose a reason for hiding this comment

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

We expect that both of these are fired. We should indicate if elements/session was loaded successfully from the endpoint but the unexpected error indicates to us that the response is malformed.

The malformed response should never happen. We have client-side validation to ensure merchants aren't sending old ephemeral keys to elements/session and server-side validation should take care of the rest. If the customer field is not available. Something erroneous has occurred on the elements/session side.

Copy link
Contributor

github-actions bot commented Oct 3, 2024

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: V1, V2)
NEW: paymentsheet-example-release-pr.apk (signature: V1, V2)

          │           compressed           │          uncompressed          
          ├───────────┬───────────┬────────┼───────────┬───────────┬────────
 APK      │ old       │ new       │ diff   │ old       │ new       │ diff   
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼────────
      dex │   3.9 MiB │   3.9 MiB │ +113 B │   8.6 MiB │   8.6 MiB │ +492 B 
     arsc │   2.3 MiB │   2.3 MiB │    0 B │   2.3 MiB │   2.3 MiB │    0 B 
 manifest │   5.1 KiB │   5.1 KiB │    0 B │  25.9 KiB │  25.9 KiB │    0 B 
      res │ 933.6 KiB │ 933.6 KiB │    0 B │   1.5 MiB │   1.5 MiB │    0 B 
   native │   2.6 MiB │   2.6 MiB │    0 B │     6 MiB │     6 MiB │    0 B 
    asset │   2.9 MiB │   2.9 MiB │  -22 B │   2.9 MiB │   2.9 MiB │  -22 B 
    other │   196 KiB │   196 KiB │   +6 B │ 430.6 KiB │ 430.6 KiB │    0 B 
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼────────
    total │  12.9 MiB │  12.9 MiB │  +97 B │  21.8 MiB │  21.8 MiB │ +470 B 

 DEX     │ old   │ new   │ diff       
─────────┼───────┼───────┼────────────
   files │     1 │     1 │  0         
 strings │ 42720 │ 42724 │ +4 (+5 -1) 
   types │ 14184 │ 14184 │  0 (+0 -0) 
 classes │ 11819 │ 11819 │  0 (+0 -0) 
 methods │ 60570 │ 60571 │ +1 (+3 -2) 
  fields │ 40170 │ 40171 │ +1 (+9 -8) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  242 │  242 │  0   
 entries │ 6253 │ 6253 │  0
APK
    compressed     │    uncompressed    │                               
──────────┬────────┼───────────┬────────┤                               
 size     │ diff   │ size      │ diff   │ path                          
──────────┼────────┼───────────┼────────┼───────────────────────────────
  3.9 MiB │ +113 B │   8.6 MiB │ +492 B │ ∆ classes.dex                 
  7.8 KiB │  -22 B │   7.7 KiB │  -22 B │ ∆ assets/dexopt/baseline.prof 
 53.4 KiB │   +7 B │ 118.3 KiB │    0 B │ ∆ META-INF/CERT.SF            
 50.1 KiB │   -1 B │ 118.2 KiB │    0 B │ ∆ META-INF/MANIFEST.MF        
──────────┼────────┼───────────┼────────┼───────────────────────────────
  4.1 MiB │  +97 B │   8.9 MiB │ +470 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   42720 │ 42724 │ +4 (+5 -1) 
  
  + CUSTOMER_SHEET_CUSTOMER_SESSION_ELEMENTS_SESSION_LOAD_FAILURE
  + CUSTOMER_SHEET_CUSTOMER_SESSION_ELEMENTS_SESSION_LOAD_SUCCESS
  + elements.customer_sheet.customer_session.elements_session.load_failure
  + elements.customer_sheet.customer_session.elements_session.load_success
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"762461f","r8-mode":"full","version":"8.5.35"}
  
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"7d54f78","r8-mode":"full","version":"8.5.35"}
  

METHODS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   60570 │ 60571 │ +1 (+3 -2) 
  
  + u5.Q a(Q, r0) → q
  + u5.Q b(Q, String)
  + u5.Q d(d) → Object
  
  - u5.Q a(Q, String)
  - u5.Q b(d) → Object
  

FIELDS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   40170 │ 40171 │ +1 (+9 -8) 
  
  + d7.c m0: c
  + d7.c n0: c[]
  + d7.d b0: d
  + d7.d c0: d[]
  + u5.P V: Object
  + u5.P W: r
  + u5.P X: int
  + u5.P Y: Object
  + u5.P Z: Q
  
  - d7.c m0: c[]
  - d7.d b0: d[]
  - u5.P V: C
  - u5.P W: Object
  - u5.P X: r
  - u5.P Y: int
  - u5.P Z: Object
  - u5.P a0: Q

@samer-stripe samer-stripe force-pushed the samer/add-elements-session-analytics-for-cs-session branch from 8f0f43d to cce31f9 Compare October 3, 2024 20:46
@samer-stripe samer-stripe marked this pull request as ready for review October 3, 2024 20:54
@samer-stripe samer-stripe requested review from a team as code owners October 3, 2024 20:54
@samer-stripe samer-stripe merged commit eeccda0 into master Oct 4, 2024
16 checks passed
@samer-stripe samer-stripe deleted the samer/add-elements-session-analytics-for-cs-session branch October 4, 2024 16:40
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.

2 participants