Skip to content

Simplify LinkHandler & source of truth for Link enablement #10858

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

Draft
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 26, 2025

Summary

Simplify LinkHandler & source of truth for Link enablement

Motivation

Simplify LinkHandler & source of truth for Link enablement

Testing

  • Added tests
  • Modified tests
  • Manually verified

Copy link
Contributor

github-actions bot commented May 26, 2025

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.1 MiB │   2.1 MiB │  0 B │   4.3 MiB │   4.3 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 KiB │     8 KiB │  0 B 
      res │ 302.9 KiB │ 302.9 KiB │  0 B │   457 KiB │   457 KiB │  0 B 
   native │   6.2 MiB │   6.2 MiB │  0 B │  15.8 MiB │  15.8 MiB │  0 B 
    asset │   7.7 KiB │   7.7 KiB │  0 B │   7.4 KiB │   7.4 KiB │  0 B 
    other │  95.7 KiB │  95.7 KiB │ +4 B │ 183.5 KiB │ 183.5 KiB │  0 B 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
    total │   9.8 MiB │   9.8 MiB │ +4 B │  21.8 MiB │  21.8 MiB │  0 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 20668 │ 20668 │ 0 (+0 -0) 
   types │  6493 │  6493 │ 0 (+0 -0) 
 classes │  5259 │  5259 │ 0 (+0 -0) 
 methods │ 31489 │ 31489 │ 0 (+0 -0) 
  fields │ 18222 │ 18222 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  164 │  164 │  0   
 entries │ 3646 │ 3646 │  0
APK
   compressed    │   uncompressed   │                                           
──────────┬──────┼───────────┬──────┤                                           
 size     │ diff │ size      │ diff │ path                                      
──────────┼──────┼───────────┼──────┼───────────────────────────────────────────
 29.2 KiB │ +3 B │  64.6 KiB │  0 B │ ∆ META-INF/CERT.SF                        
  1.2 KiB │ -3 B │   1.2 KiB │  0 B │ ∆ META-INF/CERT.RSA                       
 25.9 KiB │ +3 B │  64.5 KiB │  0 B │ ∆ META-INF/MANIFEST.MF                    
    272 B │ +1 B │     120 B │  0 B │ ∆ META-INF/version-control-info.textproto 
──────────┼──────┼───────────┼──────┼───────────────────────────────────────────
 56.5 KiB │ +4 B │ 130.5 KiB │  0 B │ (total)

@samer-stripe samer-stripe force-pushed the samer/simplify-link-handler-and-enablement branch from 8aeaa7f to d8841cd Compare May 27, 2025 14:30
WalletsState.create(
isLinkAvailable = isLinkAvailable,
isLinkAvailable = paymentMethodMetadata.availableWallets.contains(WalletType.Link),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This has the same condition as isLinkEnabled would after setupLink (linkState != null)

if (state == null) return

_linkConfiguration.value = state.configuration
linkConfiguration.value = state.configuration
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

By doing this, we effectively making this handler a logout manager outside of setting up for eager launch. I think there's an opportunity to move Link setup into PaymentElementLoader. From there, we indicate to the individual products if a session is eligible for eager launch through PaymentMethodMetadata then each individual product can decide if they want to launch into it (in this case only PaymentSheet for now)

@samer-stripe samer-stripe force-pushed the samer/simplify-link-handler-and-enablement branch from d8841cd to a341d15 Compare May 27, 2025 18:48
@samer-stripe samer-stripe force-pushed the samer/simplify-link-handler-and-enablement branch from a341d15 to 5b86c54 Compare May 28, 2025 15:13
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.

1 participant