Last modified: 2013-05-06 01:11:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T48816, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 46816 - Inappropriate things being done in Title::invalidateCache()
Inappropriate things being done in Title::invalidateCache()
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.21.x
All All
: Normal normal (vote)
: ---
Assigned To: Tyler Romeo
:
Depends on:
Blocks: code_quality
  Show dependency treegraph
 
Reported: 2013-04-03 00:12 UTC by Tim Starling
Modified: 2013-05-06 01:11 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Tim Starling 2013-04-03 00:12:37 UTC
According to the doc comment of Title::invalidateCache(), its function is to update page_touched. This is a fine thing for a function to do. Lately, two more things have been added to it:

* HTMLFileCache::clearFileCache()
* Clear action=info cache

On the face of it, it would seem that WikiPage::onArticleEdit() would be a more appropriate place for these two activities, and indeed, one of them (the HTMLFileCache update) is already there.

One problem with adding the action=info update to Title::invalidateCache() is that the data on action=info needs to be updated when the page is edited, and Title::invalidateCache() is not called when the page is edited.

Another problem is that Title::invalidateCache() is called in circumstances when the data on action=info is *not* invalidated, for example when a revision is deleted with Special:RevisionDelete.

So I suggest removing the action=info cache clear from Title::invalidateCache(), adding it to WikiPage::onArticleEdit() and WikiPage::onArticleCreate() (factored out of course), and also adding it to any other Title::invalidateCache() caller that appears to need it.

Assigning to Tyler since he added the action=info cache clear.
Comment 1 Tyler Romeo 2013-04-03 15:47:44 UTC
The only question, though, would be how the InfoAction cache would be flushed after the page is protected/unprotected, because those routes don't call WikiPage::onArticleEdit(). (They actually don't call Title::invalidateCache() either, so I doubt protection statuses are updating at all right now.)
Comment 2 Tim Starling 2013-04-15 03:26:12 UTC
(In reply to comment #1)
> The only question, though, would be how the InfoAction cache would be flushed
> after the page is protected/unprotected, because those routes don't call
> WikiPage::onArticleEdit(). (They actually don't call Title::invalidateCache()
> either, so I doubt protection statuses are updating at all right now.)

You're going to add a function that clears the action=info cache, right? InfoAction::clearCache( $title ) or something like that? You can have WikiPage::doUpdateRestrictions() call that function directly.
Comment 3 Gerrit Notification Bot 2013-04-18 17:33:34 UTC
Related URL: https://gerrit.wikimedia.org/r/59848 (Gerrit Change I38ac616d2e99fb339aca33425745368ba85b6350)
Comment 4 Gerrit Notification Bot 2013-05-06 01:11:41 UTC
Related URL: https://gerrit.wikimedia.org/r/62406 (Gerrit Change Ic12c66446c0d71f567dceb5d4630382ff41ad8bf)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links