Page MenuHomePhabricator

migrateUserGroup.php should invalidate object cache and update user_touched for affected users
Closed, ResolvedPublic

Description

Object cache for users can contains users group data (User::saveToCache).

When constructing a User object and getting user groups (via User::getGroups, as done for Special:Listusers, Special:Preferences, API userinfo, mw.config, and user group permissions, pretty much everything) - and there is cache - it means changing user groups will be ineffective.

It will appear as though the user groups haven't changed at all. Just ran into this on a small wiki of mine, took a while to figure out that it was the object cache.


Version: unspecified
Severity: normal

Details

Reference
bz40340

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:59 AM
bzimport set Reference to bz40340.

I was thinking of adding a simple loop that constructs a User object for the id, verify that the user exists by that Id, and then invalidate cache. But bug 40342 popped up.

Though not a problem right now because whether the account exists or not isn't that much of an issue because User::invalidateCache() makes sure load() is called and double-checks $this->mId again.

Merged by Aaron Schulz on the 31st.