Conversation
6eee63b to
add16ae
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Setting persisted after navigation command risks cancellation
- Moved duckChat.setInputScreenUserSetting(true) before _commands.send(OnboardingSkipped) so the setting is persisted before the navigation command can trigger ViewModel cancellation, matching the pattern used in the INPUT_SCREEN handler.
Or push these changes by commenting:
@cursor push c90b97ea55
Preview (c90b97ea55)
diff --git a/app/src/main/java/com/duckduckgo/app/onboarding/ui/page/WelcomePageViewModel.kt b/app/src/main/java/com/duckduckgo/app/onboarding/ui/page/WelcomePageViewModel.kt
--- a/app/src/main/java/com/duckduckgo/app/onboarding/ui/page/WelcomePageViewModel.kt
+++ b/app/src/main/java/com/duckduckgo/app/onboarding/ui/page/WelcomePageViewModel.kt
@@ -177,9 +177,9 @@
SKIP_ONBOARDING_OPTION -> {
viewModelScope.launch {
+ duckChat.setInputScreenUserSetting(true)
+ pixel.fire(PREONBOARDING_CONFIRM_SKIP_ONBOARDING_PRESSED)
_commands.send(OnboardingSkipped)
- pixel.fire(PREONBOARDING_CONFIRM_SKIP_ONBOARDING_PRESSED)
- duckChat.setInputScreenUserSetting(true)
}
}| viewModelScope.launch { | ||
| _commands.send(OnboardingSkipped) | ||
| pixel.fire(PREONBOARDING_CONFIRM_SKIP_ONBOARDING_PRESSED) | ||
| duckChat.setInputScreenUserSetting(true) |
There was a problem hiding this comment.
Setting persisted after navigation command risks cancellation
Medium Severity
duckChat.setInputScreenUserSetting(true) is called after _commands.send(OnboardingSkipped). Since setInputScreenUserSetting is a suspend function, it yields the main thread when switching to IO, allowing the UI to process OnboardingSkipped and potentially cancel viewModelScope before the write completes. The INPUT_SCREEN handler correctly persists data before sending Finish. The same ordering pattern would be safer here — call setInputScreenUserSetting(true) before _commands.send(OnboardingSkipped).
Please tell me if this was useful or not with a 👍 or 👎.
Additional Locations (1)
Task/Issue URL: https://app.asana.com/1/137249556945/project/1211654189969294/task/1213539375189609?focus=true ### Description Enables the toggle experience for users who skip onboarding ### Steps to test this PR _Toggle enabled_ - [x] Fresh install - [x] Skip Onboarding -> I’ve been here before + Start Browsing - [x] Verify Toggle is enabled _Toggle disabled_ - [x] Fresh install - [x] Go through onboarding - [x] Don’t select the toggle - [x] Verify Toggle is disabled <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk behavior change limited to the skip-onboarding path, setting a single DuckChat preference and adding a unit test to prevent regressions. > > **Overview** > Users who choose **Skip onboarding** now have the DuckChat input screen explicitly enabled by default via `duckChat.setInputScreenUserSetting(true)` when confirming the skip. > > Adds a focused unit test in `WelcomePageViewModelTest` to assert the preference is set when the skip flow primary CTA is clicked. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit add16ae. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->




Task/Issue URL: https://app.asana.com/1/137249556945/project/1211654189969294/task/1213539375189609?focus=true
Description
Enables the toggle experience for users who skip onboarding
Steps to test this PR
Toggle enabled
Toggle disabled
Note
Low Risk
Low risk behavior change limited to the skip-onboarding path, setting a single DuckChat preference and adding a unit test to prevent regressions.
Overview
Users who choose Skip onboarding now have the DuckChat input screen explicitly enabled by default via
duckChat.setInputScreenUserSetting(true)when confirming the skip.Adds a focused unit test in
WelcomePageViewModelTestto assert the preference is set when the skip flow primary CTA is clicked.Written by Cursor Bugbot for commit add16ae. This will update automatically on new commits. Configure here.