Page MenuHomePhabricator

Make sure PageAssessments works correctly when pages are deleted
Closed, ResolvedPublic3 Story Points

Description

Acceptance criteria:

  • When a page is deleted from a wiki, it's assessment data is also deleted from the page_assessments table.

This may already be handled by the ParserFirstCallInit + OutputPageParserOutput hooks, but if not, we may need to add additional hook handlers for when a page is deleted.

Event Timeline

kaldari created this task.Jan 26 2016, 9:04 PM
kaldari raised the priority of this task from to Normal.
kaldari updated the task description. (Show Details)
kaldari added a project: Community-Tech.
kaldari added subscribers: kaldari, Niharika.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 26 2016, 9:04 PM
DannyH set Security to None.Jan 29 2016, 6:39 PM
DannyH edited a custom field.

Some hooks that might be useful: ArticleDelete, ArticleDeleteComplete, ArticleUndelete

Niharika claimed this task.Feb 1 2016, 10:11 AM
Niharika edited projects, added Community-Tech-Sprint; removed Community-Tech.
Niharika moved this task from Ready to In Development on the Community-Tech-Sprint board.

It looks like the best practice is to delete any secondary data on page deletion. So if the article page or talk page are deleted, we should explicitly remove the assessment data from the table (probably via the ArticleDelete or ArticleDeleteComplete hooks). The easiest way to do this would be to just delete all entries with the article's page_id (rather than reparsing the whole page).

After giving it some more thought, I don't think we need to worry about article undeletion. When a page is first requested by a client after undeletion, it re-parses the page automatically, and since talk pages are almost always deleted and undeleted along with their article pages, it would be very very rare that this would make any difference. Worst case scenario, the data is missing until the talk page is next edited.

kaldari renamed this task from Make sure PageAssessments works correctly when pages are deleted and restored to Make sure PageAssessments works correctly when pages are deleted.Feb 2 2016, 1:27 AM
kaldari updated the task description. (Show Details)

Change 268108 had a related patch set uploaded (by Niharika29):
[WIP] Delete assessment records on page deleteion

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

kaldari closed this task as Resolved.Feb 5 2016, 6:01 PM
kaldari moved this task from Needs Review/Feedback to Q3 2018-19 on the Community-Tech-Sprint board.

Change 268108 merged by jenkins-bot:
Delete assessment records on page deletion

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

DannyH moved this task from Estimated to Archive on the Community-Tech board.