Page MenuHomePhabricator

Fix incorrect <link> & <guid> fields for RSS feed for watchlist
Closed, ResolvedPublic

Description

From WP:VPT

The Wikipedia watchlist shows not only changes to articles, but also certain log entries, such as deleting revisions and setting up pending changes. All these entries are also included in the RSS feed, but their <link> and <guid> fields always have the same value: https://en.wikipedia.org/w/index.php?title=article_name&diff=0, obviously because these entries are not diffs.
Therefore, I can end up with multiple <item>s with the same <guid> in my feed, which breaks most RSS readers in some way. In fact, in my current feed, I have three items for the same article with the same <guid>, all having diff=0.
For example, here's an entry for the Ha! Ha! Pyramid article, with which I was involved yesterday:
<item>
<title>Ha! Ha! Pyramid</title>
<link>https://en.wikipedia.org/w/index.php?title=Ha!_Ha!_Pyramid&diff=0</link>
<guid isPermaLink="false">https://en.wikipedia.org/w/index.php?title=Ha!_Ha!_Pyramid&diff=0</guid>
<description>purely disruptive (Drmies)</description>
<pubDate>Thu, 22 Nov 2018 15:24:00 GMT</pubDate>
<dc:creator>Drmies</dc:creator>
</item>
The source of this entry can be seen in the logs for that article.
I've had a quick look at the archives, but didn't find anything. Is this already known? Should I file a bug in phabricator for this? Isa (talk) 07:21, 23 November 2018 (UTC)

So instead we should probably link to either Special:redirect/logid/<logid> or the page that that page would redirect to.

This is potentially an appropriate scope for a gci task.

When you view an RSS feed for a watchlist, and your watchlist has a log entry in it (For example if somebody moves the page, or protects the page), the <link> tag and the <guid> tag are incorrect. They should instead link to something like https://en.wikipedia.org/w/index.php?title=Special%3ALog&logid=1234 (assuming the logid number is 1234)

The watchlist feed is from feedwatchlist action of the api.

We have to modify ApiFeedWatchlist::createFeedItem in the file includes/api/ApiFeedWatchlist.php to properly handle log entries. See ApiQueryWatchlist::ApiFeedWatchlist for details of what type of things can be passed here. In particular you need to handle the logging type of entry better.

To complete this task:

  • Add some pages to your watchlist on your test wiki (the blue star icon)
  • Protect them (or do other things to them) in order to generate some log actions
  • Look at action=apifeedwatchlist&feedformat=rss in the api. Verify the bug is present
  • Fix ApiFeedWatchlist::createFeedItem
  • Test again to make sure things are fixed.
  • Upload your patch to Wikimedia Gerrit
  • Check to make sure that jenkins bot does not flag any errors.

Event Timeline

Bawolff created this task.Dec 1 2018, 3:15 PM
Restricted Application added a project: Growth-Team. · View Herald TranscriptDec 1 2018, 3:15 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Aklapper renamed this task from <link> & <guid> fields incorrect for RSS feed for watchlist to Fix incorrect <link> & <guid> fields for RSS feed for watchlist.Dec 1 2018, 7:19 PM
Aklapper updated the task description. (Show Details)
Anomie moved this task from Unsorted to Needs Code on the MediaWiki-API board.Dec 3 2018, 2:37 PM

I can't reproduce the problem, because MediaWiki assigns a diff number to every small change (protection for example).
The reason for the change is noted in the summary and its saved as a minor edit without any content changes.
And the API action should be feedwatchlist or?

Sorry, for the confusion of the instructions. The bug is only present for certain log types, such as: newusers, renameuser, block, rights, gblblock, globalauth, massmessage.

For an example, see source of https://test.wikipedia.org/w/api.php?action=feedwatchlist&allrev=1&wlowner=BWolff+(WMF)&wltoken=234f497a9d11545a7d42b983fdd41c5188615cb6&feedformat=rss&wllimit=max

Okay thanks! Now I'm able to reproduce it.

Change 479132 had a related patch set uploaded (by LukBukkit; owner: LukBukkit):
[mediawiki/core@master] Link log entries to Special:Log on ApiFeedWatchlist

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

Change 479132 merged by jenkins-bot:
[mediawiki/core@master] Link log entries to Special:Log on ApiFeedWatchlist

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

Bawolff closed this task as Resolved.Dec 12 2018, 6:54 PM
Bawolff assigned this task to LukBukkit.