Page MenuHomePhabricator

Expired user groups are still shown in Special:Preferences/Special:UserRights after expiring, due to User cache
Closed, ResolvedPublic

Description

<Shanmugamp7> https://meta.wikimedia.org/wiki/Special:UserRights/Shanmugamp7 i added flooder and its automatically expired but still when i try to view userrights page the flooder preference is there

Seems to be a result of the 1-hour caching on User objects.

  • Should we fix this? After all, most temporary user groups will last for 6 months, 1 year, etc. 1 hour isn't a big deal (although still really confusing for users).
  • If we fix this, should we cache user::$mGroupMemberships separately from other user properties for a shorter time? Or some other solution?
  • I guess this also means the user still has the rights during this time?

Note that query pages (Special:ListUsers and Special:ActiveUsers) and Special:CentralAuth do not use this cache, so they will always display fully up-to-date info.

Event Timeline

TTO created this task.Apr 24 2017, 2:02 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 24 2017, 2:02 PM
Anomie added a comment.EditedApr 24 2017, 2:55 PM

Another option would be to have the cache time be the time until the next expiry if that's less than the current hour. You'd only need to do this if group memberships are already loaded to be included in the cache.

At a glance, perhaps that could be done around here.

Untagging MediaWiki-Cache as this isn't an issue with any of the caching systems. It's just needs the use of it in the User class to be updated. We don't currently have a good tag for issues surrounding the User object and its related classes, although we do have a few tags that relate to it directly or indirectly: #mediawiki-authentication-and-authorization, #mediawiki-user-login-and-signup, #mediawiki-user-blocking and #mediawiki-user-preferences.

Perhaps we should generalise #mediawiki-user-blocking to #mediawiki-user-management to encompass user blocking, but also user rights, user groups, and misc things such as the User object internals?

Change 350116 had a related patch set uploaded (by TTO):
[mediawiki/core@master] Expire the cache of a User object when a group membership is set to expire

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

TTO added a comment.Apr 25 2017, 5:47 AM

Perhaps we should generalise #mediawiki-user-blocking to #mediawiki-user-management to encompass user blocking, but also user rights, user groups, and misc things such as the User object internals?

That's a good idea. "User blocking" was always an oddly narrow Bugzilla component (and now Phabricator tag) so I'd support broadening it.

Change 350116 merged by jenkins-bot:
[mediawiki/core@master] Expire the cache of a User object when a group membership is set to expire

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

Change 350700 had a related patch set uploaded (by TTO; owner: TTO):
[mediawiki/core@REL1_29] Expire the cache of a User object when a group membership is set to expire

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

Change 350700 merged by jenkins-bot:
[mediawiki/core@REL1_29] Expire the cache of a User object when a group membership is set to expire

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

Krinkle closed this task as Resolved.Apr 28 2017, 3:10 AM
Krinkle assigned this task to TTO.