Skip to content

feat: detect default browser change and deliver survey#8198

Merged
anikiki merged 3 commits intodevelopfrom
feature/default-browser-changed-survey
Apr 17, 2026
Merged

feat: detect default browser change and deliver survey#8198
anikiki merged 3 commits intodevelopfrom
feature/default-browser-changed-survey

Conversation

@aibrahim-
Copy link
Copy Markdown
Contributor

@aibrahim- aibrahim- commented Apr 3, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/project/72649045549333/task/1213798658770676?focus=true

Description

When DDG loses default browser status, deliver a survey via:

  • Push notification (12h periodic background worker)
  • In-app prompt (app open if notifications not enabled)
    The survey is only shown once.

Steps to test this PR

Prerequisites

  • Internal build installed

  • Remote feature flag defaultBrowserChangedSurvey enabled (set to INTERNAL)

  • Device locale set to English

  • Fresh install or cleared app data (so defaultBrowserChangedSurveyDone is false)

  • Scenario 1: In-app survey shown when default browser changed away from DDG

  • Setup: Set DDG as default browser, then change default to another browser (e.g., Chrome via Settings > Apps > Default apps > Browser).

  • Open DDG app

  • Expected: Survey activity launches after a brief delay, loading the survey. Survey URL contains correct install age bucket and chanel, app version

  • Dismiss/complete the survey

  • Close and reopen the app

  • Expected: The survey does NOT appear again.

  • Scenario 2: Push notification delivered when app is in background

  • Setup: Set DDG as default, then change default away from DDG. Ensure notifications are enabled for DDG.

  • Don't open the app

  • Advance time on device by 1 day

  • Expected: A notification appears with title "We noticed a change" and body "DuckDuckGo is no longer your default browser. Mind telling us why?" Tapping it opens the survey. Survey URL contains correct install age bucket and chanel, app version

  • Dismiss/complete the survey

  • Close and reopen the app

  • Expected: The survey does NOT appear again.

  • Scenario 3: No survey if DDG was never the default browser

  • Setup: Fresh install. Do NOT set DDG as default at any point (skip the onboarding default browser prompt).

  • Use the app normally

  • Background/foreground the app multiple times

  • Expected: No survey appears in-app and no notification is sent

  • Scenario 4: No survey if DDG is still the default browser

  • Setup: Set DDG as default and keep it as default.

  • Open and close the app multiple times

  • Expected: No survey triggers.

  • Scenario 5: Notification skipped when notifications are disabled. Survey shown only in app

  • Scenario 6: Non-English locale suppresses the survey

  • Scenario 7: Feature flag disabled suppresses the survey

@aibrahim- aibrahim- force-pushed the feature/default-browser-changed-survey branch 3 times, most recently from 318f497 to 9cbca39 Compare April 6, 2026 13:54
@aibrahim- aibrahim- force-pushed the feature/default-browser-changed-survey branch from 9cbca39 to 30be785 Compare April 6, 2026 14:17
When DDG loses default browser status, deliver a survey via:
- Push notification (immediate, on detecting the change)
- In-app prompt (fallback on next app open if notification ignored)
- 12h periodic background worker (secondary trigger)

Survey is suppressed after the in-app prompt is shown once.
Gated behind defaultBrowserChangedSurvey remote feature flag
(default INTERNAL).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aibrahim- aibrahim- force-pushed the feature/default-browser-changed-survey branch from 30be785 to b0d84e3 Compare April 6, 2026 14:44
anikiki added 2 commits April 13, 2026 20:05
…by moving survey checks into core browser components, replacing the pending-flag with a persistent wasEverDefaultBrowser state, and centralizing worker scheduling and URL generation.
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3665914. Configure here.


logcat { "Default-browser-changed survey trigger condition met, sending notification" }
defaultBrowserChangedSurveyManager.markSurveyShown()
notificationSender.sendNotification(defaultBrowserChangedSurveyNotification)
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.

Worker marks survey done before notification interaction

Medium Severity

The worker calls markSurveyShown() when sending the notification, setting defaultBrowserChangedSurveyDone = true before the user interacts with it. If the user ignores the notification and later opens the app, shouldTriggerSurvey() returns false (since defaultBrowserChangedSurveyDone is already true), preventing the in-app fallback from ever showing. This contradicts the stated Scenario 2 behavior where the in-app survey appears after an ignored notification.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3665914. Configure here.

Copy link
Copy Markdown
Contributor Author

@aibrahim- aibrahim- left a comment

Choose a reason for hiding this comment

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

Tested, works as expected.

(I can't approve it as I'm listed as author)

@anikiki anikiki merged commit f9f12dd into develop Apr 17, 2026
31 checks passed
@anikiki anikiki deleted the feature/default-browser-changed-survey branch April 17, 2026 09:34
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