Page MenuHomePhabricator

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

Authored by ashoat on Tue, Oct 15, 11:25 AM.
Tags
None
Referenced Files
F2982159: D13715.diff
Wed, Oct 16, 1:51 AM
F2979253: D13715.id45204.diff
Tue, Oct 15, 3:35 PM
F2979252: D13715.id45200.diff
Tue, Oct 15, 3:35 PM
F2979208: D13715.id.diff
Tue, Oct 15, 3:34 PM
F2979194: D13715.diff
Tue, Oct 15, 3:34 PM
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