Skip to content

[MS-1216] ] Call viewModel.start() only on first creation of SetupFragment#1447

Merged
meladRaouf merged 1 commit into
release/2025.4.0from
fix-permissions-lifecycle
Nov 4, 2025
Merged

[MS-1216] ] Call viewModel.start() only on first creation of SetupFragment#1447
meladRaouf merged 1 commit into
release/2025.4.0from
fix-permissions-lifecycle

Conversation

@meladRaouf
Copy link
Copy Markdown
Collaborator

@meladRaouf meladRaouf commented Nov 3, 2025

JIRA ticket
Will be released in: 2025.4.0

Root cause analysis (for bugfixes only)

First known affected version: all releases

  • Changes

Fixes a bug where rotating the device with a permission dialogue (location/notification) open would cause the setup flow to advance to the next screen while the dialogue remained visible.

This was caused by the permission request event re-firing on a configuration change. The fix ensures the viewmodel.start() is only called once

Before:
https://github.com/user-attachments/assets/161bcb77-3a7f-46bb-ba47-7691d19f526b
After:
https://github.com/user-attachments/assets/94554884-fb37-47de-b4e1-0e5b3f253f77

Testing guidance

  • Start any flow (ensure Location and Notification permissions are not yet granted).
  • The "Location" permission dialog should appear.
  • Rotate the screen (dialog is on-screen).
  • Observe the bug: The flow underneath navigates to the Consent Screen while the location dialog remains, now floating over it.

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)

@cla-bot cla-bot Bot added the ... label Nov 3, 2025
@meladRaouf meladRaouf requested review from a team, BurningAXE, TristramN, alex-vt, alexandr-simprints, luhmirin-s and ybourgery and removed request for a team November 3, 2025 14:00
@meladRaouf meladRaouf force-pushed the fix-permissions-lifecycle branch 2 times, most recently from 92af632 to 478ffa2 Compare November 3, 2025 14:26
Comment thread feature/setup/src/main/java/com/simprints/feature/setup/screen/SetupViewModel.kt Outdated
Comment thread feature/setup/src/main/java/com/simprints/feature/setup/screen/SetupFragment.kt Outdated
 Added a check for savedInstanceState == null to ensure start() is called only once and not re-triggered after configuration changes (e.g. rotation).
@meladRaouf meladRaouf force-pushed the fix-permissions-lifecycle branch from 478ffa2 to 97ef984 Compare November 3, 2025 18:33
@meladRaouf meladRaouf changed the title [MS-1216] Refactor permission requests in SetupFragment to use SharedFlow and lifecycle-aware coroutines [MS-1216] ] Call viewModel.start() only on first creation of SetupFragment Nov 3, 2025
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Nov 3, 2025

@meladRaouf meladRaouf merged commit 033bab1 into release/2025.4.0 Nov 4, 2025
13 checks passed
@meladRaouf meladRaouf deleted the fix-permissions-lifecycle branch November 4, 2025 08:46
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