r59993 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59992‎ | r59993 | r59994 >
Date:14:52, 12 December 2009
Author:midom
Status:reverted (Comments)
Tags:
Comment:
I fail to see why we need to invalidate cache on watchlist edits here, do we store full watchlist in user object?
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -2264,7 +2264,6 @@
22652265 function addWatch( $title ) {
22662266 $wl = WatchedItem::fromUserTitle( $this, $title );
22672267 $wl->addWatch();
2268 - $this->invalidateCache();
22692268 }
22702269
22712270 /**
@@ -2274,7 +2273,6 @@
22752274 function removeWatch( $title ) {
22762275 $wl = WatchedItem::fromUserTitle( $this, $title );
22772276 $wl->removeWatch();
2278 - $this->invalidateCache();
22792277 }
22802278
22812279 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r60263Reverting r59993, per Tim's comment at http://www.mediawiki.org/wiki/Special:......midom16:13, 21 December 2009

Comments

#Comment by Tim Starling (talk | contribs)   05:56, 21 December 2009

User::invalidateCache() updates user_touched, which suppresses 304 "not modified" responses on all pages viewed by the user. So by calling invalidateCache() here, the watch/unwatch link will change (without a forced refresh), indicating that the user's operation was successful.

So that's why we need have it, maybe now you could explain why we need to remove it?

#Comment by Midom (talk | contribs)   10:00, 21 December 2009

Ah, thanks Tim, I was chasing all sorts of User invalidations, as they generally happen in way too many places in our codebase, holding locks for extended periods of time. I entirely forgot that this is needed for caching. Anyway, we have to decouple somehow this invalidation from main transaction - though it is usually single-user affecting thing, a slow parse somewhere will block all activity for that user.

#Comment by Midom (talk | contribs)   16:13, 21 December 2009

Reverted by r60263

Status & tagging log