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)
Wed, Dec 18, 8:39 AM
Unknown Object (File)
Wed, Dec 18, 8:39 AM
Unknown Object (File)
Wed, Dec 18, 8:38 AM
Unknown Object (File)
Wed, Dec 18, 8:36 AM
Unknown Object (File)
Thu, Dec 12, 11:48 PM
Unknown Object (File)
Wed, Dec 4, 10:39 PM
Unknown Object (File)
Sat, Nov 23, 4:32 AM
Unknown Object (File)
Nov 16 2024, 10:48 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
No Lint Coverage
Unit
No Test Coverage