Skip to content

Sever tracker-detection's remaining ties to :app internals - #9804

Draft
aibrahim- wants to merge 1 commit into
feature/aibrahim/tracker-detection/phase2-web-trackers-blocked-apifrom
feature/aibrahim/tracker-detection/phase2-severing-prep
Draft

aibrahim- wants to merge 1 commit into
feature/aibrahim/tracker-detection/phase2-web-trackers-blocked-apifrom
feature/aibrahim/tracker-detection/phase2-severing-prep

Conversation

@aibrahim-

Copy link
Copy Markdown
Contributor

Task/Issue URL: https://app.asana.com/1/137249556945/task/1216988837236386
Tech Design URL (if applicable): https://app.asana.com/1/137249556945/task/1216706645739239
API Proposals URL(s) (if applicable): None — no -api public surface changes in this PR

Description

Last PR of Phase 2. Four things stopped the tracker-detection code from being lifted out of :app as-is; none of them change behaviour.

Moshi. TdsTracker's Room type converters and TrackerDataLoader both went through :app's JsonModule, and the TDS response was parsed by the app-wide Retrofit converter — which is the reason ActionJsonAdapter had to be registered on the global Moshi in the first place. TrackerDetectionJsonModule now owns a Moshi carrying that adapter, reachable both through the graph (@TrackerDetectionMoshi) and statically for Room, which constructs type converters itself. TrackerListService.tds() returns the raw ResponseBody so the tracker-detection Moshi parses it, and :app's global Moshi no longer references tracker-detection code at all.

This is the one change in the stack that is more than a move, so: same bytes, same adapter, same failure path — the parse just happens in RealTrackerDataDownloader instead of inside Retrofit.

Pixels. BLOCKLIST_TDS_FAILURE moves from AppPixelName to a tracker-detection-owned TrackerDetectionPixelName. The pixel name on the wire is unchanged (blocklist_experiment_tds_download_failure), so this is not a telemetry change.

removeSubdomain. Its only caller is TdsEntityLookup, so it moves from :app to common-utils alongside baseHost, with its test.

RC flags. The cachedEntityLookup wrapper sat in com.duckduckgo.app.pixels.remoteconfig and moves next to the other tracker-detection flags. Note for anyone comparing against the tech design: the flag problem it worried about is moot now — optimizeTrackerEvaluationV3 and precompileTdsRegex have since been removed, and AndroidBrowserConfigFeature now lives in its own module, so no Option A/B workaround is needed.

Steps to test this PR

TDS parsing still works from both sources

  • Fresh install (or clear app data) and launch — this exercises the bundled R.raw.tds parse path
  • Visit a tracker-heavy site and confirm trackers are blocked in the privacy dashboard
  • On an internal build, trigger a TDS download from dev settings and confirm it completes and trackers still block — this exercises the new network parse path

PIR process still gets tracker data

  • Trigger a PIR scan and confirm no crash or missing-binding error in logcat for the :pir process

UI changes

Before After
No UI changes No UI changes

@aibrahim-
aibrahim- added this pull request to stack #9805 September 17, 2026 10:20
@aibrahim-
aibrahim- force-pushed the feature/aibrahim/tracker-detection/phase2-severing-prep branch from 63139ab to c736ba3 Compare September 17, 2026 10:28
Four things stopped the tracker-detection code from being moved out of
:app as-is; none of them change behaviour.

Moshi: TdsTracker's Room type converters and TrackerDataLoader went
through :app's JsonModule, and the TDS response was parsed by the
app-wide Retrofit converter, which is why ActionJsonAdapter had to be
registered globally. TrackerDetectionJsonModule now owns a Moshi with
that adapter, reachable both through the graph (@TrackerDetectionMoshi)
and statically for Room, and TrackerListService returns the raw body so
the tracker-detection Moshi parses it. :app's global Moshi no longer
references tracker-detection code.

Pixels: BLOCKLIST_TDS_FAILURE moves from AppPixelName to a
tracker-detection-owned TrackerDetectionPixelName. The pixel name on the
wire is unchanged.

removeSubdomain: its only caller is TdsEntityLookup, so it moves from
:app to common-utils alongside baseHost, with its test.

cachedEntityLookup: its wrapper sat in com.duckduckgo.app.pixels
.remoteconfig and moves next to the other tracker-detection flags.
AndroidBrowserConfigFeature already lives in its own module, so no
flag-access workaround is needed; the other two toggles the tech design
listed have since been removed.

Asana: https://app.asana.com/1/137249556945/task/1216988837236386

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@aibrahim-
aibrahim- force-pushed the feature/aibrahim/tracker-detection/phase2-severing-prep branch from c736ba3 to 48f3c15 Compare September 22, 2026 10:09

This branch has not been deployed

No deployments
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