Page MenuHomePhabricator

Make sure PageAssessments works correctly when pages are deleted
Closed, ResolvedPublic3 Estimated 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 raised the priority of this task from to Medium.
kaldari updated the task description. (Show Details)
kaldari added a project: Community-Tech.
kaldari added subscribers: kaldari, Niharika.
DannyH edited a custom field.

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

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

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

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