Skip to content

fix(engine): strip tracking params from result links - #32

Merged
ErikChevalier merged 1 commit into
mainfrom
fix/strip-trackers-from-links
May 29, 2026
Merged

fix(engine): strip tracking params from result links#32
ErikChevalier merged 1 commit into
mainfrom
fix/strip-trackers-from-links

Conversation

@ErikChevalier

Copy link
Copy Markdown
Contributor

Mirror of the desktop fix (SearchMob-Desktop#33). Result links were only stripped of trackers for de-duplication, not for the link the user actually clicks.

Problem

UrlNormalizer.normalize removes utm_*, fbclid, gclid, ... but the Aggregator used it only as the dedup key and stored the raw item.url for display (Aggregator.kt). So the in-app results and the served web page kept trackers in their links.

Fix

  • New UrlNormalizer.stripTracking(url): removes the same tracker set but preserves the URL otherwise (scheme/host case, path, trailing slash, fragment, surviving param order), so the clicked link stays faithful.
  • Aggregator.rank now stores UrlNormalizer.stripTracking(item.url); normalize remains the lossy dedup key.

Verification

  • ./gradlew :app:testDebugUnitTestUrlNormalizerTest 6/6 (3 new), AggregatorTest 7/7, EngineSupersedesTest 2/2, all green.

🤖 Generated with Claude Code

UrlNormalizer stripped utm_*/fbclid/etc. but only for the dedup key; the
aggregator stored the raw upstream URL, so the link a user clicks still carried
trackers. Add UrlNormalizer.stripTracking (lossless apart from the tracker
params: keeps scheme/host case, path, trailing slash, fragment, param order)
and surface it as the result URL. Covers the in-app results and the served
web page.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ErikChevalier
ErikChevalier merged commit d9412c5 into main May 29, 2026
2 checks passed
@ErikChevalier
ErikChevalier deleted the fix/strip-trackers-from-links branch May 29, 2026 21:06
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