Skip to content

Add reference tests for breakageData parameter#156

Draft
GuiltyDolphin wants to merge 1 commit intomainfrom
gd-breakageData
Draft

Add reference tests for breakageData parameter#156
GuiltyDolphin wants to merge 1 commit intomainfrom
gd-breakageData

Conversation

@GuiltyDolphin
Copy link
Member

@GuiltyDolphin GuiltyDolphin commented Jan 28, 2026

https://app.asana.com/1/137249556945/project/1212311623899110/task/1213015238129928?focus=true

Adds reference tests for the breakageData parameter 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 breakageData parameter, explicitly documenting that it is already pre-encoded and must be forwarded as-is.

Updates the README pseudo-code examples to pass breakageData through to getReportURL, and adds two new tests.json cases (simple + complex/special-character payload) that assert the breakageData query parameter matches the provided encoded value exactly.

Written by Cursor Bugbot for commit 3f8e5c7. This will update automatically on new commits. Configure here.

@GuiltyDolphin GuiltyDolphin self-assigned this Jan 28, 2026
@GuiltyDolphin GuiltyDolphin marked this pull request as draft January 29, 2026 14:37
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 -->
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.

1 participant