Page MenuHomePhabricator

Update maintenance/purgeOldData to remove client hint data
Closed, ResolvedPublic

Description

The data we store for client hints will have the same retention policy as user agent data. We'll want to update maintenance/purgeOldData.php to remove client hint related rows.

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptJun 1 2023, 2:19 PM
Dreamy_Jazz triaged this task as Medium priority.
Dreamy_Jazz subscribed.

Need to go ahead with this and T340959: Update CheckUser prune job to remove client hint data before display, such that the data is appropriately deleted. This is dependent on the DB structure for T258105: Implement storage for User-Agent Client Hints header data being fairly stable. My understanding is that it now is.

Change 935776 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] [WIP] clienthints: Purge expired client hint data

https://gerrit.wikimedia.org/r/935776

Change 935776 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] clienthints: Purge expired client hint data

https://gerrit.wikimedia.org/r/935776

Suggested QA steps:

  • Reduce $wgCUDMaxAge to a small enough value for the test
  • (Ideally) Empty cu_useragent_clienthints_map and cu_useragent_clienthints for the test
  • Make some test edits
  • Wait until these actions are over $wgCUDMaxAge seconds old
  • Run the maintenance script maintenace/purgeOldData.php (without adding --quiet)
  • Check that "Purging data from cu_changes", "Purging data from cu_log_event", and "Purging data from cu_private_event" are outputted to the console.
  • Check that directly underneath these lines, a line starting with "Purged X rows" where X is a integer.
    • Ensure that if edits were made, the line under "cu_changes" has X greater than 0
    • For these lines, if X is greater than 0 check that Y is greater than 0 in "... with Y client hint mapping rows purged"
    • If X is zero, ensure all other numbers in that line are zero
  • Inspect the DB to ensure that no rows exist in cu_useragent_clienthints_map or cu_useragent_clienthints

@Dreamy_Jazz I came across no issues when purging. Client hint data are removed after purging and meet the requirements above as seen in the screenshots. I will move this to Done. Thanks for all your work!

Purging Data

T337943_CheckUser_ClientHintData_Purge.png (258ร—1 px, 51 KB)

No rows exist after Purge- cu_useragent_clienthints_map or cu_useragent_clienthints

T337943_CheckUser_ClientHintData_NoRows.png (176ร—808 px, 31 KB)