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 complex list item encoding #5574

Merged
merged 3 commits into from Sep 16, 2022

Conversation

awush-stripe
Copy link
Collaborator

Summary

When encoding a list of object in form-url-encoding, we must include the index when the list contains non-primitives.

Motivation

https://jira.corp.stripe.com/browse/BOUNCER-1305

Testing

  • Added tests
  • Modified tests
  • Manually verified

@github-actions
Copy link
Contributor

github-actions bot commented Sep 16, 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 │ 15.8 MiB │ 15.8 MiB │ -11 B │  53.4 MiB │  53.4 MiB │ -772 B 
     arsc │  1.8 MiB │  1.8 MiB │   0 B │   1.8 MiB │   1.8 MiB │    0 B 
 manifest │  4.1 KiB │  4.1 KiB │   0 B │  18.9 KiB │  18.9 KiB │    0 B 
      res │    1 MiB │    1 MiB │   0 B │   1.8 MiB │   1.8 MiB │    0 B 
   native │  2.5 MiB │  2.5 MiB │   0 B │   5.9 MiB │   5.9 MiB │    0 B 
    asset │    3 MiB │    3 MiB │ +18 B │     3 MiB │     3 MiB │  +18 B 
    other │ 81.8 KiB │ 81.8 KiB │   0 B │ 155.7 KiB │ 155.7 KiB │    0 B 
──────────┼──────────┼──────────┼───────┼───────────┼───────────┼────────
    total │ 24.2 MiB │ 24.2 MiB │  +7 B │    66 MiB │    66 MiB │ -754 B 

         │          raw           │             unique             
         ├────────┬────────┬──────┼────────┬────────┬──────────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff         
─────────┼────────┼────────┼──────┼────────┼────────┼──────────────
   files │      4 │      4 │    0 │        │        │              
 strings │ 256009 │ 256008 │   -1 │ 219027 │ 219025 │ -2 (+26 -28) 
   types │  45047 │  45045 │   -2 │  41440 │  41438 │ -2 (+1 -3)   
 classes │  38623 │  38621 │   -2 │  38623 │  38621 │ -2 (+1 -3)   
 methods │ 224993 │ 224984 │   -9 │ 217254 │ 217246 │ -8 (+8 -16)  
  fields │ 164383 │ 164376 │   -7 │ 163429 │ 163422 │ -7 (+4 -11)  

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  334 │  334 │  0   
 entries │ 6242 │ 6242 │  0
APK
    compressed    │    uncompressed     │                                
─────────┬────────┼──────────┬──────────┤                                
 size    │ diff   │ size     │ diff     │ path                           
─────────┼────────┼──────────┼──────────┼────────────────────────────────
 2.4 MiB │ -400 B │  7.4 MiB │ -1.8 KiB │ ∆ classes3.dex                 
 3.2 MiB │ +389 B │  8.4 MiB │ +1.1 KiB │ ∆ classes2.dex                 
 9.7 KiB │  +21 B │  9.6 KiB │    +21 B │ ∆ assets/dexopt/baseline.prof  
   659 B │   -3 B │    527 B │     -3 B │ ∆ assets/dexopt/baseline.profm 
─────────┼────────┼──────────┼──────────┼────────────────────────────────
 5.6 MiB │   +7 B │ 15.8 MiB │   -754 B │ (total)
DEX
STRINGS:

   old    │ new    │ diff         
  ────────┼────────┼──────────────
   219027 │ 219025 │ -2 (+26 -28) 
  +  
  ���
  ���
  
  ���
  
  ���
  
  ���
  ���
  ��2�0�J�����0�2�����0�2��������0�0�H&¨�	
  + 1
  
  ���
  
  ���
  
  ���
  
  ���
  ���
  ���
  ���
  ���
  ���
  *��
  �2�0�J�����0�2�����0�2��������0�0�H�J��	��0�2��
  ����0�H�J����0�2��
  ��0�H�¨��
  + ��
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  
  ���
  
  ���
  
  ���
  
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  ���
  
  ���
  
  ���
  ���
  ���
  ���
  ���
  ��
  ���
  ���
  ���
  ���
  ���
  ������2
  ������0�0�2�����0�0�B�¢����J��F��0GH�J��H��0G2��I��00H�@ø�¢���JJ��K��0GH�J��L��0G2��M��0�2��N����0�H�J��O��0PH�J��Q����0�H�@ø�¢���RJ��S��0G2��T����0UH�J��V��0GH�J��W��0GH�J��X��0G2��Y����0�H�J��Z��0GH�J��[��0GH�J��\��0GH�J��]��0GH�J��^��0GH�J��_��0GH�J����0GH�J��a��0GH�J��b��0GH�J��c��0GH�J��d��0GH�J��e��0GH�R�����0�8TX���¢�
  ��
  �������	R����0�8TX���¢�
  ��������
  �	R�������0�X��¢��
  R�����0�X��¢��
  R�����0�X��¢��
  R�������0�X��¢��
  R�����0�X��¢��
  ������R�����0�8BX���¢�
  �����������R�� ��0!8TX���¢�
  ��_������#R��%��0&8TX���¢�
  ��)�����'�(R��*��0�8TX���¢�
  ��,�����+�	R��-����0.X��¢��
  R��/����00X��¢��
  R��1��02X��¢��
  ���3�4R��5��06X��¢��
  ���7�8R��9��0:8PX���¢�
  ��=�����;�<R��>����0�X��¢��
  ���?�@��A�BR��C����0�X��¢��
  ���D�@��E�B���
  ���¨�f
  + Intent()
              .pu…          )
              )
  + Lcom/stripe/android/stripecardscan/cardimageverification/CardImageVerificationActivity_cardImageVerificationComplete_1;
  + SMAP
  CardImageVerificationActivity.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardImageVerificationActivity.kt
  com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationActivity
  + 2 SimpleScanActivity.kt
  com/stripe/android/stripecardscan/scanui/SimpleScanActivity
  *L
  1#1,659:1
  591#2,6:660
  591#2,6:666
  591#2,6:672
  591#2,6:678
  *S KotlinDebug
  *F
  + 1 CardImageVerificationActivity.kt
  com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationActivity
  *L
  494#1:660,6
  510#1:666,6
  528#1:672,6
  559#1:678,6
  *E
  
  + SMAP
  CardImageVerificationActivity.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardImageVerificationActivity.kt
  com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationActivity_scanFlow_2_1
  + 2 fake.kt
  kotlin/jvm/internal/FakeKt
  *L
  1#1,659:1
  1#2:660
  *E
  
  + SMAP
  CardScanActivity.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardScanActivity.kt
  com/stripe/android/stripecardscan/cardscan/CardScanActivity
  + 2 _Collections.kt
  kotlin/collections/CollectionsKt___CollectionsKt
  + 3 ViewGroup.kt
  androidx/core/view/ViewGroupKt
  *L
  1#1,345:1
  1851#2:346
  1852#2:349
  148#3,2:347
  *S KotlinDebug
  *F
  + 1 CardScanActivity.kt
  com/stripe/android/stripecardscan/cardscan/CardScanActivity
  *L
  242#1:346
  242#1:349
  244#1:347,2
  *E
  
  + SMAP
  CardScanActivity.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardScanActivity.kt
  com/stripe/android/stripecardscan/cardscan/CardScanActivity_scanFlow_2_1
  + 2 fake.kt
  kotlin/jvm/internal/FakeKt
  *L
  1#1,345:1
  1#2:346
  *E
  
  + SMAP
  CardScanFragment.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardScanFragment.kt
  com/stripe/android/stripecardscan/cardscan/CardScanFragment
  + 2 _Collections.kt
  kotlin/collections/CollectionsKt___CollectionsKt
  + 3 ViewGroup.kt
  androidx/core/view/ViewGroupKt
  *L
  1#1,315:1
  1851#2:316
  1852#2:319
  148#3,2:317
  *S KotlinDebug
  *F
  + 1 CardScanFragment.kt
  com/stripe/android/stripecardscan/cardscan/CardScanFragment
  *L
  217#1:316
  217#1:319
  219#1:317,2
  *E
  
  + SMAP
  CardScanFragment.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardScanFragment.kt
  com/stripe/android/stripecardscan/cardscan/CardScanFragment_scanFlow_2_1
  + 2 fake.kt
  kotlin/jvm/internal/FakeKt
  *L
  1#1,315:1
  1#2:316
  *E
  
  + SMAP
  CardScanFragment.kt
  Kotlin
  *S Kotlin
  *F
  + 1 CardScanFragment.kt
  com/stripe/android/stripecardscan/cardscan/CardScanFragment_scanFlow_2_1_onResult_2
  + 2 fake.kt
  kotlin/jvm/internal/FakeKt
  *L
  1#1,315:1
  1#2:316
  *E
  
  + access_cardImageVerificationComplete
  + card_scanned
  + scan_complete
  + ,
  ���
  ��
  ���
  ��_
  ���
  ���
  �� 
  ���
  ���
  ���
  ����Ç��2�0�:��B���¢����J_��������0�����0�0�2��������0�����0�J�����0�2���������0�������0�J�����0�2���������0�������0�J�	������0�0
  2���������0�������0�H�J�������0�0
  2
  �������
...✂

@awush-stripe awush-stripe enabled auto-merge (squash) September 16, 2022 22:44
Copy link

@jaimepark-stripe jaimepark-stripe left a comment

Choose a reason for hiding this comment

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

nice find. the indexing thing is a big ouch tho 🚢

@awush-stripe awush-stripe merged commit 73023b6 into master Sep 16, 2022
@awush-stripe awush-stripe deleted the awush/omit_missing_fields_from_scanstats branch September 16, 2022 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants