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

Properly attribute product_usage tokens in PaymentAnalyticsRequestFactory. #8424

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

samer-stripe
Copy link
Collaborator

@samer-stripe samer-stripe commented May 6, 2024

Summary

PaymentAnalyticsRequestFactory has a defaultProductUsageTokens parameter which is used for all its added internal methods but does not override the base request method to add the tokens if needed. This PR overrides the base method to add the tokens if an existing field is not found.

Motivation

Resolves RUN_MOBILESDK-2978

Helps properly attribute PaymentSheet analytics events (mc_) to the used product (PaymentSheet or FlowController).

Testing

  • Added tests
  • Modified tests
  • Manually verified

Copy link
Contributor

github-actions bot commented May 6, 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 │ -27 B │   8.6 MiB │   8.6 MiB │ +140 B 
     arsc │   2.2 MiB │   2.2 MiB │   0 B │   2.2 MiB │   2.2 MiB │    0 B 
 manifest │     5 KiB │     5 KiB │   0 B │  25.2 KiB │  25.2 KiB │    0 B 
      res │ 907.5 KiB │ 907.5 KiB │   0 B │   1.4 MiB │   1.4 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 │ +13 B │   2.9 MiB │   2.9 MiB │  +13 B 
    other │   194 KiB │   194 KiB │  -4 B │ 423.6 KiB │ 423.6 KiB │    0 B 
──────────┼───────────┼───────────┼───────┼───────────┼───────────┼────────
    total │  12.7 MiB │  12.7 MiB │ -18 B │  21.6 MiB │  21.6 MiB │ +153 B 

 DEX     │ old   │ new   │ diff       
─────────┼───────┼───────┼────────────
   files │     1 │     1 │  0         
 strings │ 43007 │ 43007 │  0 (+1 -1) 
   types │ 14756 │ 14756 │  0 (+0 -0) 
 classes │ 12461 │ 12461 │  0 (+0 -0) 
 methods │ 61021 │ 61022 │ +1 (+1 -0) 
  fields │ 40304 │ 40304 │  0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  242 │  242 │  0   
 entries │ 6028 │ 6028 │  0
APK
    compressed    │    uncompressed    │                                           
──────────┬───────┼───────────┬────────┤                                           
 size     │ diff  │ size      │ diff   │ path                                      
──────────┼───────┼───────────┼────────┼───────────────────────────────────────────
  3.9 MiB │ -27 B │   8.6 MiB │ +140 B │ ∆ classes.dex                             
  7.4 KiB │ +13 B │   7.2 KiB │  +13 B │ ∆ assets/dexopt/baseline.prof             
 49.4 KiB │  -3 B │ 116.6 KiB │    0 B │ ∆ META-INF/MANIFEST.MF                    
    272 B │  +1 B │     120 B │    0 B │ ∆ META-INF/version-control-info.textproto 
 52.7 KiB │  -1 B │ 116.7 KiB │    0 B │ ∆ META-INF/CERT.SF                        
  1.2 KiB │  -1 B │   1.2 KiB │    0 B │ ∆ META-INF/CERT.RSA                       
──────────┼───────┼───────────┼────────┼───────────────────────────────────────────
    4 MiB │ -18 B │   8.8 MiB │ +153 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff      
  ───────┼───────┼───────────
   43007 │ 43007 │ 0 (+1 -1) 
  
  + ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:88b5585,r8-mode:full,version:8.3.37}
  
  - ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:a2290d0,r8-mode:full,version:8.3.37}
  

METHODS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   61021 │ 61022 │ +1 (+1 -0) 
  
  + s6.f a(a, Map) → b

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

1 participant