Page MenuHomePhabricator

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



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:, 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:

<title>Ha! Ha! Pyramid</title>
<guid isPermaLink="false">!_Ha!_Pyramid&diff=0</guid>
<description>purely disruptive (Drmies)</description>
<pubDate>Thu, 22 Nov 2018 15:24:00 GMT</pubDate>

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 (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

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)

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?

firefox_2018-12-10_22-24-44.png (1×1 px, 87 KB)
firefox_2018-12-10_22-24-57.png (1×1 px, 93 KB)

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

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

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

Bawolff assigned this task to LukBukkit.