Page MenuHomePhabricator

RCFeed reports events with undocumented type "142"
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

Here is one example:

event: message
id: [{"topic":"eqiad.mediawiki.recentchange","partition":0,"timestamp":1659719698001},{"topic":"codfw.mediawiki.recentchange","partition":0,"offset":-1}]
data: {"$schema":"/mediawiki/recentchange/1.0.0","meta":{"uri":"https://www.wikidata.org/wiki/Topic:X0nxplc5phbl5gdu","request_id":"db1735b7-b824-4b7f-9848-f2238f133c5e","id":"aca35395-5e5a-4a40-8f09-1fdf82deb483","dt":"2022-08-05T17:14:58Z","domain":"www.wikidata.org","stream":"mediawiki.recentchange","topic":"eqiad.mediawiki.recentchange","partition":0,"offset":4064140254},"id":1749989023,"type":"142","namespace":2600,"title":"Topic:X0nxplc5phbl5gdu","comment":"Emu commented on \"Lisa-Maria Kellermayr: Duplication of information, should be modeled within the object\" (The information you entered isn’t information about Dr. Kellermayr (the subject) but rather about her place of death (P20) (the object)....)","timestamp":1659719698,"user":"Emu","bot":false,"server_url":"https://www.wikidata.org","server_name":"www.wikidata.org","server_script_path":"/w","wiki":"wikidatawiki","parsedcomment":"Emu commented on "Lisa-Maria Kellermayr: Duplication of information, should be modeled within the object" (The information you entered isn’t information about Dr. Kellermayr (the subject) but rather about her place of death (P20) (the object)....)"}

What happens?:
Flow edits are reported in the RC feed with "type":"142".

What should have happened instead?:
The event should be reported with a different type, or a new type. The RC feed is documented at Manual:RCFeed, which defines type as:

Type of recent change event (rc_type). One of "edit", "new", "log", "categorize", or "external".

In addition, the RecentChanges schema (https://gerrit.wikimedia.org/r/admin/repos/schemas/event/primary, in the file jsonschema/mediawiki/recentchange/current.yaml) specifies:

type:
  description: >
    Type of recentchange event (rc_type). One of "edit", "new", "log",
    "categorize", or "external". (See Manual:Recentchanges table#rc_type)
  type: string

`

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

I don't know where to report this -- it does seem like a minor issue but it is one that caused me some headaches when debugging downstream code. Would it be possible to change the type to "edit"? I'm not familiar enough to know if this is a Flow issue or an RCFeed issue.

Event Timeline

L235 renamed this task from RCFeed documentation does not include undocumented type "142" to RCFeed reports events with undocumented type "142".Aug 5 2022, 5:34 PM
Umherirrender added a subscriber: Umherirrender.

Flow produce its own recent changes line and set the type RC_FLOW to 142, that is what you are seeing. As the core types are known there are mapped to the string values (via RecentChange::parseFromRCType), but flow is not known there.

Just "edit" could be a problem, because such entries can look different to the edit ones. For the old IRC feed is there special code to map

Maybe "log", then? The schema is less well-defined there, and it's used by other services (such as the abuse filter log) that don't create entries on Special:Log.

Change 822151 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[schemas/event/primary@master] Update docs for mediawiki/recentchange type field

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

I think Flow has switched from rc_type to rc_source for most internal purposes (T74157: [Story] Use rc_source and drop RC_TYPE) so could as well use one of the core types. But I'm not sure anyone has the bandwidth to experiment with that. Updated the docs (1, 2) for now.

Maybe there should be a config variable for mapping the IDs to human-readable names.

Change 822151 merged by Ottomata:

[schemas/event/primary@master] Update docs for mediawiki/recentchange type field

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

@L235 is there any other place where you would expect better documentation?

Etonkovidova claimed this task.

@L235 is there any other place where you would expect better documentation?

No, this is great, thank you very much.