Page MenuHomePhabricator

User with negative edit count
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
Leaderboard
Apr 3 2022, 3:20 PM
Referenced Files
F35036381: image.png
Apr 3 2022, 3:20 PM
Tokens
"The World Burns" token, awarded by DannyS712."The World Burns" token, awarded by TheresNoTime.

Description

List of steps to reproduce (step by step, including full links if applicable):
See https://meta.wikimedia.org/wiki/Special:CentralAuth?target=Tetesco+sotto+il+sale
What happens?:
The wiki thinks that this user has a negative number of edits (-999) on it.wikipedia despite them actually having a positive number of edits. This also causes CentralAuth to report an incorrect global edit count.

This is the only user with a negative edit count.

What should have happened instead?:
The edit count should be positive.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:

image.png (2×3 px, 316 KB)

Event Timeline

I have no idea where this is comming from, but it is not a regular thing. It is the only user in itwiki with a negative editcount. And in e.g. enwiki there is not a single user with a negative edit count. Also the account is quite old. So this is some random data corruption?

MariaDB [itwiki_p]> select user_id, user_name, user_editcount from user where user_editcount < 0;
+---------+-----------------------+----------------+
| user_id | user_name             | user_editcount |
+---------+-----------------------+----------------+
|  110871 | Tetesco sotto il sale |           -999 |
+---------+-----------------------+----------------+
1 row in set (0.64 sec)

MariaDB [itwiki_p]>
MariaDB [enwiki_p]> select user_id, user_name, user_editcount from user where user_editcount < 0;
Empty set (42.14 sec)

MariaDB [enwiki_p]>
Reedy triaged this task as Lowest priority.Apr 3 2022, 9:19 PM
Reedy added a subscriber: Reedy.

I ran that over all wikis... There is literally only that one user, on one wiki with the problem.

We should fix that one row and call this done.

Reedy claimed this task.
MariaDB [itwiki]> select * from actor where actor_user = 110871;
+----------+------------+-----------------------+
| actor_id | actor_user | actor_name            |
+----------+------------+-----------------------+
|   272621 |     110871 | Tetesco sotto il sale |
+----------+------------+-----------------------+
1 row in set (0.001 sec)

MariaDB [itwiki]> select count(*) from revision where rev_actor = 272621;
+----------+
| count(*) |
+----------+
|       88 |
+----------+
1 row in set (0.002 sec)

And the fix:

MariaDB [itwiki]> UPDATE user SET user_editcount=88 where user_id = 110871;
Query OK, 1 row affected (0.003 sec)
Rows matched: 1  Changed: 1  Warnings: 0
MariaDB [itwiki]> select * from actor where actor_user = 110871;
+----------+------------+-----------------------+
| actor_id | actor_user | actor_name            |
+----------+------------+-----------------------+
|   272621 |     110871 | Tetesco sotto il sale |
+----------+------------+-----------------------+
1 row in set (0.001 sec)

MariaDB [itwiki]> select count(*) from revision where rev_actor = 272621;
+----------+
| count(*) |
+----------+
|       88 |
+----------+
1 row in set (0.002 sec)

And the fix:

MariaDB [itwiki]> UPDATE user SET user_editcount=88 where user_id = 110871;
Query OK, 1 row affected (0.003 sec)
Rows matched: 1  Changed: 1  Warnings: 0

What about deleted edits? I was going to suggest setting to null so that UserEditTracker::initializeUserEditCount() would populate it according to existing logic

They’re indef blocked as a sock puppet. Does anyone really care?

That and UserEditTracker::initializeUserEditCount() only does revision anyway...

That and UserEditTracker::initializeUserEditCount() only does revision anyway...

Oh, I misread it. Nevermind then, doesn't matter