Closed Bug 1926936 Opened 1 year ago Closed 1 year ago

Store a log of tracker purges in Bounce Tracking Protection storage

Categories

(Core :: Privacy: Anti-Tracking, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: emz, Assigned: emz)

References

(Blocks 2 open bugs)

Details

Attachments

(5 files)

This allows for better troubleshooting when we expose it via nsIBounceTrackingProtection. It also allows us to log a warning to the website console the next time a previously purged site is visited (Bug 1844561).

The data we're adding needs to be cleared properly via the existing cleaner in ClearDataService.

Blocks: 1926951
Assignee: nobody → pbz
Status: NEW → ASSIGNED

Some implementation notes:

Extend BounceTrackingMapEntry to hold OriginAttributes so we can get the OA later to populate the purge log. While we’re at it we can use this entry type in a bunch of places where we currently only use array of string etc.

Add purged host list to state global
Can’t we directly in the purge logic after the callback append to this list? We should only do it on a successful purge.

Extend the database with an additional table for purge history. The columns should be:

  1. OA suffix
  2. Site host
  3. Purge time stamp

How do we ensure that this table doesn’t get over full? We could on startup do a cleanup job which removes entries older than 30 days.

Could also keep this log entirely in memory? Would give us limited insight into breakage potentially. PBM won’t have persistence anyway. Always on users will have limited traceability into purges.

The clear data service needs full integration with this table so it’s properly cleared when the user clears e.g. history.

On PBM exit the in memory state of the purge log needs to be dropped.

I'm going a bit back and forth about whether data persistence is actually necessarily. It does add a lot of complexity for a troubleshooting / debug only feature. If a user notices within the same session that site data is missing they can look up the purge log. I'll go with this version for now. If we find it worthwhile to have disk persistence in the future we can easily iterate on the current patches.

In the next patch we will use BounceTrackingMapEntry to store purged sites in storage.

Blocks: 1932148
Pushed by pzuhlcke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8d981a08962b Extend BounceTrackingMapEntry to include OA and use it in more places. r=anti-tracking-reviewers,timhuang https://hg.mozilla.org/integration/autoland/rev/178d8013d13e Create in-memory BTP purge log. r=anti-tracking-reviewers,timhuang https://hg.mozilla.org/integration/autoland/rev/54322c4cfda1 Integrate purge log with BTP clear data methods. r=anti-tracking-reviewers,timhuang https://hg.mozilla.org/integration/autoland/rev/4173afd4efab Extend BTP tests to check purge log. r=anti-tracking-reviewers,timhuang https://hg.mozilla.org/integration/autoland/rev/6779ac4a1374 Only add to purge and content blocking log when BTP is fully enabled. r=anti-tracking-reviewers,timhuang
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: