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

Fix cardValidCallback being added multiple times in CardInputWidget #4560

Merged
merged 3 commits into from
Feb 10, 2022

Conversation

brnunes-stripe
Copy link
Contributor

@brnunes-stripe brnunes-stripe commented Feb 9, 2022

Summary

Fixes bug introduced by #4504, where the callback can get added multiple times if there are multiple calls to updatePostalRequired()

Motivation

RUN_MOBILESDK-724

Testing

  • Added tests
  • Modified tests
  • Manually verified

skyler-stripe
skyler-stripe previously approved these changes Feb 9, 2022
Copy link
Contributor

@skyler-stripe skyler-stripe left a comment

Choose a reason for hiding this comment

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

🤦 thanks for fixing this!

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2022

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: none)
NEW: paymentsheet-example-release-pr.apk (signature: none)

          │          compressed           │         uncompressed          
          ├───────────┬───────────┬───────┼───────────┬───────────┬───────
 APK      │ old       │ new       │ diff  │ old       │ new       │ diff  
──────────┼───────────┼───────────┼───────┼───────────┼───────────┼───────
      dex │  11.8 MiB │  11.8 MiB │ -58 B │  40.1 MiB │  40.1 MiB │ +24 B 
     arsc │   1.6 MiB │   1.6 MiB │   0 B │   1.6 MiB │   1.6 MiB │   0 B 
 manifest │   2.7 KiB │   2.7 KiB │   0 B │  11.1 KiB │  11.1 KiB │   0 B 
      res │ 697.1 KiB │ 697.1 KiB │   0 B │   1.1 MiB │   1.1 MiB │   0 B 
    asset │  77.8 KiB │  77.8 KiB │  -1 B │ 109.3 KiB │ 109.3 KiB │  -1 B 
    other │  78.3 KiB │  78.3 KiB │  -2 B │   154 KiB │   154 KiB │   0 B 
──────────┼───────────┼───────────┼───────┼───────────┼───────────┼───────
    total │  14.2 MiB │  14.2 MiB │ -61 B │  43.1 MiB │  43.1 MiB │ +23 B 

         │          raw           │            unique             
         ├────────┬────────┬──────┼────────┬────────┬─────────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff        
─────────┼────────┼────────┼──────┼────────┼────────┼─────────────
   files │      3 │      3 │    0 │        │        │             
 strings │ 189052 │ 189052 │    0 │ 170340 │ 170340 │ 0 (+10 -10) 
   types │  32886 │  32886 │    0 │  30879 │  30879 │ 0 (+0 -0)   
 classes │  28488 │  28488 │    0 │  28488 │  28488 │ 0 (+0 -0)   
 methods │ 165500 │ 165500 │    0 │ 160603 │ 160603 │ 0 (+0 -0)   
  fields │ 122103 │ 122103 │    0 │ 121430 │ 121430 │ 0 (+0 -0)   

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  297 │  297 │  0   
 entries │ 5389 │ 5389 │  0
APK
   compressed    │  uncompressed   │                                                       
─────────┬───────┼─────────┬───────┤                                                       
 size    │ diff  │ size    │ diff  │ path                                                  
─────────┼───────┼─────────┼───────┼───────────────────────────────────────────────────────
 2.8 MiB │ -58 B │ 7.7 MiB │ +24 B │ ∆ classes3.dex                                        
   184 B │  -2 B │     6 B │   0 B │ ∆ META-INF/androidx.activity_activity-compose.version 
 5.6 KiB │  -1 B │ 5.4 KiB │  -1 B │ ∆ assets/dexopt/baseline.prof                         
─────────┼───────┼─────────┼───────┼───────────────────────────────────────────────────────
 2.8 MiB │ -61 B │ 7.7 MiB │ +23 B │ (total)
DEX
STRINGS:

   old    │ new    │ diff        
  ────────┼────────┼─────────────
   170340 │ 170340 │ 0 (+10 -10) 
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget
  + 2 Delegates.kt
  kotlin/properties/Delegates
  + 3 fake.kt
  kotlin/jvm/internal/FakeKt
  + 4 _Collections.kt
  kotlin/collections/CollectionsKt___CollectionsKt
  + 5 View.kt
  androidx/core/view/ViewKt
  + 6 Context.kt
  androidx/core/content/ContextKt
  + 7 TextView.kt
  androidx/core/widget/TextViewKt
  *L
  1#1,1263:1
  33#2,3:1264
  33#2,3:1267
  33#2,3:1270
  1#3:1273
  764#4:1274
  855#4,2:1275
  1849#4,2:1277
  1849#4,2:1279
  1849#4,2:1281
  1741#4,3:1283
  1849#4,2:1286
  1849#4,2:1288
  1720#4,3:1290
  1849#4,2:1306
  1849#4:1308
  1850#4:1335
  1849#4,2:1345
  321#5,4:1293
  52#6,9:1297
  52#6,9:1336
  58#7,23:1309
  93#7,3:1332
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget
  *L
  283#1:1264,3
  309#1:1267,3
  321#1:1270,3
  231#1:1274
  231#1:1275,2
  232#1:1277,2
  390#1:1279,2
  394#1:1281,2
  464#1:1283,3
  468#1:1286,2
  477#1:1288,2
  516#1:1290,3
  716#1:1306,2
  786#1:1308
  786#1:1335
  974#1:1345,2
  658#1:1293,4
  693#1:1297,9
  841#1:1336,9
  787#1:1309,23
  787#1:1332,3
  *E
  
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_CardNumberSlideEndAnimation
  + 2 View.kt
  androidx/core/view/ViewKt
  *L
  1#1,1263:1
  321#2,4:1264
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_CardNumberSlideEndAnimation
  *L
  1139#1:1264,4
  *E
  
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_CardNumberSlideStartAnimation
  + 2 View.kt
  androidx/core/view/ViewKt
  *L
  1#1,1263:1
  321#2,4:1264
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_CardNumberSlideStartAnimation
  *L
  1065#1:1264,4
  *E
  
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_CvcSlideEndAnimation
  + 2 View.kt
  androidx/core/view/ViewKt
  *L
  1#1,1263:1
  321#2,4:1264
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_CvcSlideEndAnimation
  *L
  1167#1:1264,4
  *E
  
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_CvcSlideStartAnimation
  + 2 View.kt
  androidx/core/view/ViewKt
  *L
  1#1,1263:1
  321#2,4:1264
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_CvcSlideStartAnimation
  *L
  1093#1:1264,4
  *E
  
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_ExpiryDateSlideEndAnimation
  + 2 View.kt
  androidx/core/view/ViewKt
  *L
  1#1,1263:1
  321#2,4:1264
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_ExpiryDateSlideEndAnimation
  *L
  1152#1:1264,4
  *E
  
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_ExpiryDateSlideStartAnimation
  + 2 View.kt
  androidx/core/view/ViewKt
  *L
  1#1,1263:1
  321#2,4:1264
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_ExpiryDateSlideStartAnimation
  *L
  1078#1:1264,4
  *E
  
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_PostalCodeSlideEndAnimation
  + 2 View.kt
  androidx/core/view/ViewKt
  *L
  1#1,1263:1
  321#2,4:1264
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_PostalCodeSlideEndAnimation
  *L
  1184#1:1264,4
  *E
  
  + SMAP
  CardInputWidget.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_PostalCodeSlideStartAnimation
  + 2 View.kt
  androidx/core/view/ViewKt
  *L
  1#1,1263:1
  321#2,4:1264
  *S KotlinDebug
  *F
  + 1 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget_PostalCodeSlideStartAnimation
  *L
  1110#1:1264,4
  *E
  
  + SMAP
  TextView.kt
  Kotlin
  *S Kotlin
  *F
  + 1 TextView.kt
  androidx/core/widget/TextViewKt_addTextChangedListener_textWatcher_1
  + 2 CardInputWidget.kt
  com/stripe/android/view/CardInputWidget
  + 3 TextView.kt
  androidx/co
...✂

@brnunes-stripe brnunes-stripe merged commit 131aff1 into master Feb 10, 2022
@brnunes-stripe brnunes-stripe deleted the brnunes/cardwidget branch February 10, 2022 01:24
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