Add survey sampling to throttle DefaultBrowserChangedSurveyEvaluator#8511
Open
catalinradoiu wants to merge 1 commit into
Conversation
The evaluator now consults DefaultBrowserChangedSurveySampler after eligibility; the sampler reads samplingRate (0-100) from the defaultBrowserChangedSurvey toggle's remote settings and defaults to 100. Non-sampled evaluations return Skipped so the coordinator can fall through to the next modal evaluator
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
10 tasks
anikiki
approved these changes
May 11, 2026
Contributor
anikiki
left a comment
There was a problem hiding this comment.
Looks good and works as expected! 🎉
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Task/Issue URL: https://app.asana.com/1/137249556945/project/1211724162604201/task/1214555274723652?focus=true
Description
Introduces per-evaluation sampling for the default-browser-changed survey. A new
DefaultBrowserChangedSurveySamplerreads asamplingRate(0–100) from the survey toggle's remotesettingspayload and uses it to probabilistically decide whether the survey should be shown on any given evaluation. If thesamplingRatekey is absent or the settings are malformed, the sampler defaults to 100% (always in sample). The sampler is only consulted aftershouldTriggerSurvey()returns true, so it does not interfere with the existing eligibility checks.Steps to test this PR
Sampling behaviour
Enable these feature flags by default:
reactivateUsers,defaultBrowserWinBackPromptanddefaultBrowserChangedSurveyconst val PRIVACY_REMOTE_CONFIG_URwith "https://gist.githubusercontent.com/catalinradoiu/69a9e72f87a6524ba8ec5c8d7370066c/raw/7bee4df0ed05b24f93cac3d422d6662cc6fe57ba/scratch_5.json"UI changes
No UI changes
Note
Medium Risk
Changes the conditions under which the default-browser-changed survey is shown by adding probabilistic sampling driven by remote toggle settings, which could alter prompt frequency and ordering. Risk is limited to survey/prompt behavior but includes new settings parsing and randomness.
Overview
Adds per-evaluation sampling to throttle the default-browser-changed in-app survey:
DefaultBrowserChangedSurveyEvaluatorImplnow consults a newDefaultBrowserChangedSurveySampleraftershouldTriggerSurvey()and skips showing the survey when not in sample.Introduces
RealDefaultBrowserChangedSurveySampler, which reads asamplingRate(0–100) from the feature togglesettingsJSON (defaulting to 100% on missing/malformed data) and uses randomness to decide inclusion, along with updated/new unit tests covering the new skip paths and sampling behavior.Reviewed by Cursor Bugbot for commit 2c21db7. Bugbot is set up for automated code reviews on this repo. Configure here.