Page MenuHomePhabricator

[lib] Return null for successful fetch with no result in UserIdentityCache
ClosedPublic

Authored by ashoat on Oct 15 2024, 11:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 10:48 AM
Unknown Object (File)
Sat, Nov 16, 10:48 AM
Unknown Object (File)
Sat, Nov 16, 10:47 AM
Unknown Object (File)
Sat, Nov 16, 10:47 AM
Unknown Object (File)
Mon, Nov 4, 8:08 AM
Unknown Object (File)
Sat, Nov 2, 7:09 AM
Unknown Object (File)
Fri, Nov 1, 11:03 AM
Unknown Object (File)
Thu, Oct 31, 2:13 AM
Subscribers

Details

Summary

getUserIdentities was implemented to match the API of the underlying findUserIdentities, so that it could be a drop-in replacement. This API has no way to distinguish a successful fetch with no result versus a timed-out fetch.

UserIdentityCache exposes a method that currently doesn't have any uses: getCachedUserIdentity. We could use this method to distinguish the two cases, except that we don't currently cache timed-out results (failedQueryCacheTimeout is 0).

By switching these two, we make sure we store null for a successful fetch with no result. Then we can treat a value that is missing from cache after an attempted fetch to be a timeout case.

Test Plan

Tested in combination with the following diff

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable