Page MenuHomePhabricator

Update cuci_temp_edit table each time a temp user edits
Closed, ResolvedPublic2 Estimated Story Points

Description

Technical background

In T368151 we added a central table, cuci_temp_edit, to keep track of which wikis have been recently edited by a temporary user from a particular IP address.

The table records the IP address, wiki and timestamp of the latest edit (code).

CheckUser already updates the cu_changes table whenever an edit is saved, via RecentChangeSaveHandler::onRecentChange_save. It uses a service method CheckUserInsert::updateCheckUserData.

What needs doing

The service and hook handler can be adapted to update cuci_temp_edit. Note that we should:

  • Only record contributions from temporary users
  • Only record edits
  • Just update the timestamp if a row for the same IP/wiki already exists in the table
  • Refer to the cuci_wiki_map table for the ID of the wiki
  • Consider placing this update in a job or DeferredUpdate

Related Objects

StatusSubtypeAssignedTask
Resolvedkostajh
DeclinedNone
In ProgressNiharika
OpenNone
OpenDreamy_Jazz
ResolvedDreamy_Jazz
OpenNiharika
OpenSTran
OpenNone
OpenNone
OpenNone
ResolvedSTran
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz

Event Timeline

JayCano set the point value for this task to 2.Aug 26 2024, 10:21 AM

Consider placing this update in a job or DeferredUpdate

DeferredUpdate would need less code/infrastructure and should be fine for this use case.

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

[mediawiki/extensions/CheckUser@master] [WIP] Write to cuci_temp_edit in CheckUserCentralIndexManager

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

Change #1068080 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Write to cuci_temp_edit in CheckUserCentralIndexManager

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

dom_walden subscribed.

I see entries being inserted/updated into cuci_temp_edit when a temporary account makes an edit. It does not happen when a named account or an anonymous (IP) user does.

A lot of the same testing I did for T373021 also applies here. Unlike cuci_user, I wasn't able to reproduce the issue of missing or out-of-date entries in cuci_temp_edit when triggering a lot of RecentChange events.