Page MenuHomePhabricator

Cache user notification and message counts
ClosedPublic

Authored by epriestley on Jun 5 2016, 1:54 AM.
Tags
None
Referenced Files
F14347851: D16041.diff
Thu, Dec 19, 3:42 AM
Unknown Object (File)
Mon, Dec 16, 10:39 AM
Unknown Object (File)
Sat, Dec 14, 9:47 AM
Unknown Object (File)
Thu, Dec 12, 10:54 PM
Unknown Object (File)
Wed, Dec 11, 6:47 AM
Unknown Object (File)
Thu, Dec 5, 11:24 AM
Unknown Object (File)
Wed, Dec 4, 12:15 PM
Unknown Object (File)
Wed, Nov 27, 11:11 AM
Subscribers
None

Details

Summary

Ref T4103. Ref T10078. This puts a user cache in front of notification and message counts.

This reduces the number of queries issued on every page by 4 (2x building the menu, 2x building Quicksand data).

Also fixes some minor issues:

  • Daemons could choke on sending mail in the user's translation.
  • No-op object updates could fail in the daemons.
  • Questionable data access pattern in the file query coming out of the profile file cache.
Test Plan
  • Sent myself notifications. Saw count go up.
  • Cleared them by visiting objects and clearing all notifications. Saw count go down.
  • Sent myself messages. Saw count go up.
  • Cleared them by visiting threads. Saw count go down.

Diff Detail

Repository
rP Phabricator
Branch
setting30
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 12463
Build 15792: Run Core Tests
Build 15791: arc lint + arc unit

Unit TestsFailed

TimeTest
50 msPhabricatorAccessControlTestCase::Unknown Unit Message ("")
Assertion failed, expected 'true' (at PhabricatorAccessControlTestCase.php:261): Expect user 'normal' to be allowed access to 'Default'. ACTUAL VALUE
0 msPhabricatorLocalTimeTestCase::Unknown Unit Message ("")
EXCEPTION (PhabricatorDataNotAttachedException): Attempting to access attached data on PhabricatorUser (via getUserSetting()), but the data is not actually attached. Before accessing attachable data on an object, you must load and attach it. Data is normally attached by calling the corresponding needX() method on the Query class when the object is loaded. You can also call the corresponding attachX() method explicitly.
0 msAlmanacNamesTestCase::Unknown Unit Message ("")
30 assertions passed.
0 msAlmanacServiceTypeTestCase::Unknown Unit Message ("")
1 assertion passed.
0 msAphrontHTTPSinkTestCase::Unknown Unit Message ("")
6 assertions passed.
View Full Test Results (2 Failed · 327 Passed)

Event Timeline

epriestley retitled this revision from to Cache user notification and message counts.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.
This revision is now accepted and ready to land.Jun 5 2016, 2:54 PM
This revision was automatically updated to reflect the committed changes.