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

Support networking relink flows #10000

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented Jan 27, 2025

Summary

This pull request adds support for networked relink.

Networked bank accounts that require an update will display an Update required subtitle, and actioning on them will create an auth repair session that we then map to an auth session. From there, the steps are largely the same as for a ”normal” auth flow.

Note that the flow will complete successfully, but the SDK will return a Canceled result. This will be fixed backend-side.

Motivation

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

Copy link
Contributor

github-actions bot commented Jan 27, 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 MiB │     2 MiB │  0 B │   4.1 MiB │   4.1 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.6 KiB │ 302.6 KiB │  0 B │ 456.7 KiB │ 456.7 KiB │  0 B 
   native │   6.2 MiB │   6.2 MiB │  0 B │  15.8 MiB │  15.8 MiB │  0 B 
    asset │   7.1 KiB │   7.1 KiB │  0 B │   6.9 KiB │   6.9 KiB │  0 B 
    other │  90.8 KiB │  90.8 KiB │ +8 B │   171 KiB │   171 KiB │  0 B 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
    total │   9.6 MiB │   9.6 MiB │ +8 B │  21.5 MiB │  21.5 MiB │  0 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 19981 │ 19981 │ 0 (+0 -0) 
   types │  6194 │  6194 │ 0 (+0 -0) 
 classes │  4985 │  4985 │ 0 (+0 -0) 
 methods │ 29823 │ 29823 │ 0 (+0 -0) 
  fields │ 17542 │ 17542 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  164 │  164 │  0   
 entries │ 3624 │ 3624 │  0
APK
   compressed    │   uncompressed   │                        
──────────┬──────┼───────────┬──────┤                        
 size     │ diff │ size      │ diff │ path                   
──────────┼──────┼───────────┼──────┼────────────────────────
 28.6 KiB │ +5 B │  63.2 KiB │  0 B │ ∆ META-INF/CERT.SF     
 25.4 KiB │ +3 B │  63.1 KiB │  0 B │ ∆ META-INF/MANIFEST.MF 
──────────┼──────┼───────────┼──────┼────────────────────────
   54 KiB │ +8 B │ 126.3 KiB │  0 B │ (total)

@tillh-stripe tillh-stripe force-pushed the tillh/fc-support-relink branch 2 times, most recently from 044eb9c to c13812c Compare January 28, 2025 16:44
@tillh-stripe tillh-stripe changed the title [WIP] Relink flow Support FC relink flow Jan 28, 2025
@tillh-stripe tillh-stripe force-pushed the tillh/fc-support-relink branch from 1ac9279 to 2c010b4 Compare January 31, 2025 16:20
@tillh-stripe tillh-stripe changed the base branch from master to tillh/fc-repair-flow January 31, 2025 16:20
@tillh-stripe tillh-stripe force-pushed the tillh/fc-support-relink branch 2 times, most recently from 07606b1 to 0471915 Compare January 31, 2025 18:54
Base automatically changed from tillh/fc-repair-flow to master February 3, 2025 22:18
@tillh-stripe tillh-stripe force-pushed the tillh/fc-support-relink branch from 81957dc to 54e7315 Compare February 7, 2025 16:42
Comment on lines 103 to 102
if (!isRelink) {
storeSavedToLinkMessage(manifest, selectedAccountIds.size)
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don’t want to show […] and was saved to Link, since the account is technically already in Link.

@@ -226,6 +228,7 @@ private fun LoadedContent(
// is Loading or Success (completing auth after redirect)
authenticationStatus = authenticationStatus,
showInModal = showInModal,
showSecondaryButton = !isRelinkSession,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In networked relink, we only show a single Continue button.

@tillh-stripe tillh-stripe changed the title Support FC relink flow Support networking relink flows Feb 7, 2025
@tillh-stripe tillh-stripe force-pushed the tillh/fc-support-relink branch from fc2fbba to 804f758 Compare February 7, 2025 17:59
@tillh-stripe tillh-stripe force-pushed the tillh/fc-support-relink branch from 804f758 to 0ff00cc Compare February 13, 2025 15:40
@tillh-stripe tillh-stripe force-pushed the tillh/fc-support-relink branch from 0ff00cc to 7698695 Compare February 13, 2025 16:34
import com.stripe.android.financialconnections.repository.CoreAuthorizationPendingNetworkingRepairRepository
import javax.inject.Inject

internal fun interface IsNetworkingRelinkSession {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We have multiple screens where we want to know if we’re in a networking relink flow. This is easier to inject and test than using the full CoreAuthorizationPendingNetworkingRepairRepository.

)
)
}
if (result.networkingSuccessful == true) {
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 was broken before, since result.networkingSuccessful?.let { … } would run even if networkingSuccessful was false.

Comment on lines +123 to +127
if (pane == Pane.BANK_AUTH_REPAIR) {
initializeBankAuthRepair(sync)
} else {
initializePartnerAuth(sync)
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Using one ViewModel for both cases.

@@ -26,6 +26,6 @@ internal class CoreAuthorizationPendingNetworkingRepairRepository @Inject constr

@Parcelize
data class State(
val coreAuthorization: String? = null
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removing the nullability here, since having a non-null state should be an indication that a networking relink flow is underway.

flow = repairSession.flow,
display = repairSession.display,
_isOAuth = repairSession.isOAuth,
nextPane = Pane.SUCCESS,
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 aligns with Web.

@tillh-stripe tillh-stripe marked this pull request as ready for review February 13, 2025 16:50
@tillh-stripe tillh-stripe requested review from a team as code owners February 13, 2025 16:50
@tillh-stripe tillh-stripe force-pushed the tillh/fc-support-relink branch from c0fff9a to 63c6d1d Compare February 13, 2025 18:05
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