HomePhabricator
Diffusion Comm eb8ba0adac2f

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

Description

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

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

Reviewers: will, varun

Reviewed By: will

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D13715

Details