stripe-android icon indicating copy to clipboard operation
stripe-android copied to clipboard

Rewrite `retryOnException` without delicate Coroutines API

Open tillh-stripe opened this issue 1 year ago • 1 comments

Summary

This pull request rewrites the retryOnException method to avoid using the delicate Channel.isClosedForSending API. Instead, we use a simple while loop and break out of it once we receive a result or exceed the maximum number of retries.

Motivation

Avoid delicate coroutines API.

Testing

  • [ ] Added tests
  • [x] Modified tests
  • [ ] Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

tillh-stripe avatar Apr 05 '24 21:04 tillh-stripe

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.2 MiB │   4.2 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.6 MiB │   1.6 MiB │   0 B │   1.6 MiB │   1.6 MiB │  0 B 
    other │  99.8 KiB │  99.8 KiB │ -10 B │ 206.8 KiB │ 206.8 KiB │  0 B 
──────────┼───────────┼───────────┼───────┼───────────┼───────────┼──────
    total │  12.3 MiB │  12.3 MiB │ -10 B │  25.8 MiB │  25.8 MiB │  0 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 21470 │ 21470 │ 0 (+0 -0) 
   types │  6645 │  6645 │ 0 (+0 -0) 
 classes │  5411 │  5411 │ 0 (+0 -0) 
 methods │ 31009 │ 31009 │ 0 (+0 -0) 
  fields │ 18100 │ 18100 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  164 │  164 │  0   
 entries │ 3404 │ 3404 │  0
APK
    compressed    │  uncompressed   │                                           
──────────┬───────┼──────────┬──────┤                                           
 size     │ diff  │ size     │ diff │ path                                      
──────────┼───────┼──────────┼──────┼───────────────────────────────────────────
 38.2 KiB │ -10 B │ 86.7 KiB │  0 B │ ∆ META-INF/CERT.SF                        
    271 B │  +1 B │    120 B │  0 B │ ∆ META-INF/version-control-info.textproto 
  1.2 KiB │  -1 B │  1.2 KiB │  0 B │ ∆ META-INF/CERT.RSA                       
──────────┼───────┼──────────┼──────┼───────────────────────────────────────────
 39.6 KiB │ -10 B │   88 KiB │  0 B │ (total)

github-actions[bot] avatar Apr 05 '24 21:04 github-actions[bot]