Skip to content

Fix CardScanGoogleLauncher attempting to reference unregistered launcher after PE is closed - #13261

Merged
samer-stripe merged 1 commit into
masterfrom
samer/fix-card-scan-google-crash
Oct 16, 2026
Merged

samer-stripe merged 1 commit into
masterfrom
samer/fix-card-scan-google-crash

Conversation

@samer-stripe

@samer-stripe samer-stripe commented Jun 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fix CardScanGoogleLauncher attempting to reference unregistered launcher and launch from it after PE is closed, resulting in an IllegalStateException crash.

Motivation

RUN_MOBILESDK-5402

Testing

  • Added tests
  • Modified tests
  • Manually verified

@samer-stripe
samer-stripe force-pushed the samer/fix-card-scan-google-crash branch from b0265f7 to 30c97cc Compare August 11, 2026 17:13
@samer-stripe
samer-stripe marked this pull request as ready for review August 11, 2026 17:17
@samer-stripe
samer-stripe requested review from a team as code owners August 11, 2026 17:17
@samer-stripe
samer-stripe force-pushed the samer/fix-card-scan-google-crash branch from 30c97cc to 47695fc Compare October 15, 2026 20:21
@samer-stripe samer-stripe changed the title Fix crash occurring in CardScanGoogleLauncher Fix CardScanGoogleLauncher attempting to reference unregistered launcher after PE is closed Oct 16, 2026
} catch (_: IllegalStateException) {
deferredIntentSenderRequest = intentSenderRequest
}
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

There are a ton of other issues with this scanner is built that I need to be resolved. A lot of the work (fetching intent, checking availability) is being done in the composition scope of the Scan card button that should not be happening.

This PR fixes the initial crash but a good amount of follow-up work should be done. I'll open up tickets for these.

onSuccess = { intentSenderRequest ->
eventsReporter.onCardScanStarted("google_pay")
activityLauncher.launch(intentSenderRequest, options)
launchIntentSenderOrDefer(intentSenderRequest)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not a blocker, but I wonder if we could fix this with coroutines. We'd pass CoroutineScope from rememberCardScanGoogleLauncher to this class and await an activityLauncher on the main dispatcher

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

In general, we should make this request in the view model scope rather than the composition scope, something I'll look to fix separately.

@samer-stripe
samer-stripe merged commit 9c2e8e7 into master Oct 16, 2026
46 checks passed
@samer-stripe
samer-stripe deleted the samer/fix-card-scan-google-crash branch October 16, 2026 15:20
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.

2 participants