Add reference tests for breakageData parameter#156
Draft
GuiltyDolphin wants to merge 1 commit intomainfrom
Draft
Add reference tests for breakageData parameter#156GuiltyDolphin wants to merge 1 commit intomainfrom
GuiltyDolphin wants to merge 1 commit intomainfrom
Conversation
GuiltyDolphin
added a commit
to duckduckgo/Android
that referenced
this pull request
Feb 26, 2026
Task/Issue URL: https://app.asana.com/1/137249556945/project/1212311623899110/task/1213015238129927?focus=true ### Description Adds support for the `breakageData` parameter which is passed from CSS. The parameter is returned as part of the Content Scope Scripts breakage reporting feature as a pre-encoded string which should then be passed along as-is to the breakage report request without further encoding. ### Steps to test this PR Covered by unit tests and reference tests (duckduckgo/privacy-reference-tests#156). I've manually tested the change and can see the `breakageData` parameter populated correctly. 1. Make sure you're using the latest Content Scope Scripts 2. Set the state of `webDetection`, `webInterferenceDetection`, and `breakageReporting` to `"enabled"` in the remote config 3. Visit https://duckduckgo.com/?q=disable%20adblocker 4. Add logcat filtering for `breakageData` 5. Make a breakage report. Verify that you can see the populated parameter (e.g., `breakageData=%7B%22webDetection%22%3A%5B%7B%22detectorId%22%3A%22adwalls.generic_en%22%2C%22detected%22%3Atrue%7D%5D%2C%22detectorData%22%3A%7B%22botDetection%22%3A%7B%22detected%22%3Afalse%2C%22type%22%3A%22botDetection%22%2C%22results%22%3A%5B%5D%7D%2C%22fraudDetection%22%3A%7B%22detected%22%3Afalse%2C%22type%22%3A%22fraudDetection%22%2C%22results%22%3A%5B%5D%7D%2C%22adwallDetection%22%3A%7B%22detected%22%3Atrue%2C%22type%22%3A%22adwallDetection%22%2C%22results%22%3A%5B%7B%22detected%22%3Atrue%2C%22detectorId%22%3A%22generic%22%7D%5D%7D%2C%22youtubeAds%22%3A%7B%22detected%22%3Afalse%2C%22type%22%3A%22youtubeAds%22%2C%22results%22%3A%5B%5D%7D%7D%7D&test=1`) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Medium risk because it changes the broken-site reporting payload and encoding path; incorrect handling could break report submission or produce malformed analytics data. > > **Overview** > Adds end-to-end support for a new `breakageData` field in broken-site reporting, captured from content-scope-scripts and stored in `BrokenSiteContext`. > > Plumbs `breakageData` through report construction (`BrokenSiteData`/`BrokenSite`) and updates the sender to include it in `encodedParams` *without re-encoding* (treating it as pre-encoded). Updates unit/reference tests to cover null vs present `breakageData` behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ace8968. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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.
https://app.asana.com/1/137249556945/project/1212311623899110/task/1213015238129928?focus=true
Adds reference tests for the
breakageDataparameter to ensure the value doesn't get double-encoded.Note
Low Risk
Only updates reference tests/docs to include a new optional URL parameter check; no production logic changes.
Overview
Adds support in the broken-site reporting reference suite for an optional
breakageDataparameter, explicitly documenting that it is already pre-encoded and must be forwarded as-is.Updates the README pseudo-code examples to pass
breakageDatathrough togetReportURL, and adds two newtests.jsoncases (simple + complex/special-character payload) that assert thebreakageDataquery parameter matches the provided encoded value exactly.Written by Cursor Bugbot for commit 3f8e5c7. This will update automatically on new commits. Configure here.