Last modified: 2014-10-21 08:01:19 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 T74266, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 72266 - User::isAnon should not cause an unnecessary load() call
User::isAnon should not cause an unnecessary load() call
Status: NEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: performance
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-20 17:03 UTC by Tisza Gergő
Modified: 2014-10-21 08:01 UTC (History)
0 users

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


Attachments

Description Tisza Gergő 2014-10-20 17:03:11 UTC
The current implementation of User::isAnon() causes the user details to be loaded if the user is not anonymous. This can be expensive and should be avoided, especially since the logging code calls isAnon() all the time. This has resulted in some defensive coding in wfLogProfilingData which can in some cases get the anon state wrong - see https://gerrit.wikimedia.org/r/#/c/119942/12/includes/GlobalFunctions.php for more context.

isAnon() should come with a guarantee (and unit tests) that load() is not triggered.

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


Navigation
Links