Page MenuHomePhabricator

[CatWatch] [Regression] Categorization event should honour bot flag (changes by bots shown if hidebots=1)
Closed, ResolvedPublic5 Story Points

Description

See https://meta.wikimedia.org/w/index.php?title=Special:RecentChanges&from=2015082012070 for example. COIBot is in the bot group and is marking these edits as bot edits, but the category changes are shown on RC.

Expected: It shoudn't be shown while hidebots=1 (default)


See also:

Event Timeline

Glaisher raised the priority of this task from to Needs Triage.
Glaisher updated the task description. (Show Details)
Glaisher added a subscriber: Glaisher.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 20 2015, 12:08 PM
Krenair updated the task description. (Show Details)Aug 20 2015, 12:14 PM
Krenair set Security to None.
Krenair added a subscriber: Krenair.
MariaDB [metawiki_p]> select rc_bot, count(*) from recentchanges where rc_this_oldid = 13219209 group by rc_bot;
+--------+----------+
| rc_bot | count(*) |
+--------+----------+
|      0 |        3 |
|      1 |        1 |
+--------+----------+
2 rows in set (0.07 sec)
Krinkle renamed this task from RecentChanges shows category changes by bots when hidebots=1 to [Regression] Categorization event should honour bot flag (changes by bots shown if hidebots=1).Aug 20 2015, 12:55 PM
Krinkle updated the task description. (Show Details)
Krinkle added a project: Regression.

I tried locally but it marked the category membership change as a bot edit as well...

Mjbmr added a subscriber: Mjbmr.Aug 20 2015, 3:32 PM
MariaDB [metawiki_p]> select rc_type, rc_bot from recentchanges where rc_bot = 1 and rc_type = 6;
Empty set (0.05 sec)

Change 232748 had a related patch set uploaded (by Mjbmr):
Retrieve rc_bot direclty from the row

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

Change 232748 abandoned by Mjbmr:
Retrieve rc_bot directly from the row

Reason:
T109638

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

Tobi_WMDE_SW renamed this task from [Regression] Categorization event should honour bot flag (changes by bots shown if hidebots=1) to [CatWatch] [Regression] Categorization event should honour bot flag (changes by bots shown if hidebots=1).Aug 28 2015, 7:17 AM
Addshore closed this task as Invalid.Aug 31 2015, 3:20 PM

@Glaisher I can not reproduce this

RC through the api shows bot flags for both the edit and the cat change:

The edits dont show up in the default view of RC

With show bots they do

Glaisher reopened this task as Open.Aug 31 2015, 4:20 PM

It's valid bug even if you can't reproduce it locally. :)

It looks like RecentChange::newFromConds() (which is called by Revision::getRecentChange() ) does the query from DB_SLAVE so I'm guessing that this was due to slave lag. Since correspondingRC could be null due to this and rc_bot attribute is within an if ( $this->correspondingRC ) it would default to $bot = 0 causing it to pass wrong parameters to RecentChange::notifyCategorization(). I can't confirm this because it looks like the cat change rows from the rc table has been removed but this seems like the most plausible explanation because slave lag is sometimes high on Wikimedia while it is almost always 0 on local dev environments.

Well, a slightly nasty fix for this would be to just default rc_bot to 1 when no revision is present.
This would mean that edits by the magic reserved user are marked as bot (ie. category changes caused by parser function and lua), as are revisions when this case happens.

Change 233441 had a related patch set uploaded (by Addshore):
[WIP] Enable users to watch category membership changes (try #2)

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

Change 239065 had a related patch set (by Addshore) published:
Enable users to watch category membership changes #2

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

Change 233441 abandoned by Addshore:
Enable users to watch category membership changes #2

Reason:
Please see the following changes which have been factored out of this one:
https://gerrit.wikimedia.org/r/#/c/239061/
https://gerrit.wikimedia.org/r/#/c/239060/
https://gerrit.wikimedia.org/r/#/c/239065/

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

Change 241730 had a related patch set uploaded (by Addshore):
Retry getting CatChange RC from master

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

Change 241730 merged by jenkins-bot:
Retry getting CatChange RC from master

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

Change 239065 merged by jenkins-bot:
Enable users to watch category membership changes #2

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

Addshore closed this task as Resolved.Oct 20 2015, 9:54 PM
Addshore moved this task from Review to Done on the TCB-Team-Sprint-2015-10-14 board.
Restricted Application removed a subscriber: Mjbmr. · View Herald TranscriptFeb 24 2016, 7:24 PM

If it is intentional, then it should be documented (on the watchlist page, when catwatch is activated) because it is highly irritating.

Restricted Application added projects: Growth-Team, User-Addshore. · View Herald TranscriptOct 26 2018, 10:47 AM