Page MenuHomePhabricator

page-links-change stream doesn't capture links on page deletion
Closed, ResolvedPublic

Description

As reported by @Samwalton9 at T115119#4957283:

This is now live at https://stream.wikimedia.org/v2/stream/page-links-change
From some initial testing it looks to be working well for links added & removed, including page creations. However, it doesn't catch links removed by being on a page that gets deleted. Undeleting the page counts as a page creation and tracks the link addition(s).

Details

Related Gerrit Patches:

Event Timeline

bmansurov triaged this task as Medium priority.Feb 15 2019, 3:14 PM
bmansurov created this task.
Restricted Application added a project: Analytics. · View Herald TranscriptFeb 15 2019, 3:14 PM
bmansurov renamed this task from page-links-stream doesn't caputre links on page deletion to page-links-change stream doesn't caputre links on page deletion.Feb 15 2019, 3:17 PM
Samwalton9 renamed this task from page-links-change stream doesn't caputre links on page deletion to page-links-change stream doesn't capture links on page deletion.Feb 15 2019, 3:18 PM
Pchelolo added a subscriber: Pchelolo.

Indeed, haven't thought about that. On page deletion no LinksUpdate is scheduled, LinksDeletionUpdate is used instead which doesn't call a hook we use to construct the event.

Also, the hook we use for page deletion, ArticleDeleteComplete is run after the links are already deleted from the links tables. I guess we could listen to ArticleDelete hook, and grab the existing links with $wikiPage->getTitle()->getLinksFrom() for local links and either create a convenience method in the Title for external links or supply additional parameters to grab them.

@Samwalton9

Undeleting the page counts as a page creation and tracks the link addition(s).

I cannot reproduce this part. Undeleting the page doesn't result in link additions for me. Can you please double check if that's still true?

@Pchelolo thanks for looking into this. I want to see if I can share and reuse what we have already.

fdans moved this task from Incoming to Radar on the Analytics board.Feb 18 2019, 4:52 PM

@Samwalton9 thanks for confirming. Now I know that something is wrong with my setup.

bmansurov moved this task from Staged to In Progress on the Research board.Feb 19 2019, 2:52 PM

Change 491532 had a related patch set uploaded (by Bmansurov; owner: Bmansurov):
[mediawiki/core@master] WIP: ArticleDeleteComplete: pass along links

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

Change 491856 had a related patch set uploaded (by Bmansurov; owner: Bmansurov):
[mediawiki/extensions/EventBus@master] page-links-change: emit link deletions on page delete

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

Change 494557 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] Derive LinksDeletionUpdate from LinksUpdate

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

bmansurov reassigned this task from bmansurov to daniel.Mar 27 2019, 9:05 PM

I'm assigning the task to you, Daniel, since you worked on it. Thanks for your help.

Change 494557 had a related patch set uploaded (by Mobrovac; owner: Daniel Kinzler):
[mediawiki/core@master] Make LinksDeletionUpdate a subclass of LinksUpdate

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

Change 494557 merged by jenkins-bot:
[mediawiki/core@master] Make LinksDeletionUpdate a subclass of LinksUpdate

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

mobrovac closed this task as Resolved.Mar 27 2019, 11:39 PM
mobrovac added a subscriber: mobrovac.

With Gerrit 494557 landing in master (ETA for production: 2019-04-04), we should be done here. If there are any issues, please reopen the task.

Change 491532 abandoned by Bmansurov:
ArticleDeleteComplete: pass along links

Reason:
Not needed. See I665320e27da8edc2867b47d181cc0f324e75d102

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

Change 491856 abandoned by Bmansurov:
page-links-change: emit link deletions on page delete

Reason:
Not needed as I665320e27da8edc2867b47d181cc0f324e75d102 fires the hook we're listening to.

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