Skip to content

[MS-1380] Launch camera setup in viewLifecycleOwner.lifecycleScope#1610

Open
BurningAXE wants to merge 1 commit intomainfrom
MS-1380-Crash-when-user-goes-to-exit-screen-while-camera-is-setting-up
Open

[MS-1380] Launch camera setup in viewLifecycleOwner.lifecycleScope#1610
BurningAXE wants to merge 1 commit intomainfrom
MS-1380-Crash-when-user-goes-to-exit-screen-while-camera-is-setting-up

Conversation

@BurningAXE
Copy link
Contributor

@BurningAXE BurningAXE commented Mar 6, 2026

JIRA ticket
Will be released in: 2026.2.0

Root cause analysis (for bugfixes only)

First known affected version: since face capture exists!?

  • There's a suspension point in setUpCamera() after which the binding is accessed
  • If user navigates to the exit screen while camera is setting up, view will be destroyed (and hence null) when suspension resumes

Notable changes

  • Use viewLifecycleOwner for the whole camera setup coroutine so it's lifecycle safe

Testing guidance

  • Navigate to face capture and immediately press back button (multiple times)

Additional work checklist

  • Effect on other features and security has been considered
  • Design document marked as "In development" (if applicable)
  • External (Gitbook) and internal (Confluence) Documentation is up to date (or ticket created)
  • Test cases in Testiny are up to date (or ticket created)
  • Other teams notified about the changes (if applicable)

… avoid trying to access view after it's been destroyed
@cla-bot cla-bot bot added the ... label Mar 6, 2026
@BurningAXE BurningAXE requested a review from Copilot March 6, 2026 17:45
@BurningAXE BurningAXE marked this pull request as ready for review March 6, 2026 17:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a Face Capture crash by moving the camera setup coroutine to the view lifecycle so it gets cancelled when the Fragment’s view is destroyed (e.g., user navigates away mid-setUpCamera()).

Changes:

  • Launch setUpCamera() in viewLifecycleOwner.lifecycleScope instead of lifecycleScope to avoid accessing binding after onDestroyView.

You can also share your feedback on Copilot code review. Take the survey.

@BurningAXE BurningAXE requested review from a team, TristramN, alex-vt, alexandr-simprints, luhmirin-s, meladRaouf and ybourgery and removed request for a team March 6, 2026 17:48
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 6, 2026

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.

3 participants