Page MenuHomePhabricator

[lib] Handle identity timeout when fetching device lists
ClosedPublic

Authored by inka on Oct 18 2024, 3:36 AM.
Tags
None
Referenced Files
F3300744: D13750.id45296.diff
Sun, Nov 17, 9:36 PM
F3298632: D13750.id45296.diff
Sun, Nov 17, 7:37 AM
Unknown Object (File)
Wed, Nov 6, 3:37 AM
Unknown Object (File)
Fri, Nov 1, 4:04 AM
Unknown Object (File)
Fri, Nov 1, 3:25 AM
Unknown Object (File)
Thu, Oct 31, 11:23 PM
Unknown Object (File)
Thu, Oct 31, 1:23 AM
Unknown Object (File)
Wed, Oct 30, 12:08 PM
Subscribers

Details

Summary

issue: ENG-9725

Test Plan

Tested that if the timeout occurs and the error is thrown, the accountMissingStatus of users is not updated and the user is not deleted, even if they were missing a device list

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lib/handlers/user-infos-handler.react.js
171–173 ↗(On Diff #45276)

If a timeout occurred, we actually want to query for those users again

lib/hooks/peer-list-hooks.js
60–64 ↗(On Diff #45276)

I don't think it's worth merging this with the function used in UserIdentityCacheProvider. They are so simple that merging them would just introduce complexity at the call site.

lib/utils/identity-service.js
48 ↗(On Diff #45276)

The timeout before an error on the native side is thrown is 30s D13355
Ideally we would be getting informed by the native side about the timeout and only handling it on the JS side. But because the native error handling is broken for now (ENG-9730) I am using this solution that is mimicking the solution from UserIdentityCacheProvider which is also working around this problem.
Using the same value as UserIdentityCacheProvider.

inka requested review of this revision.Oct 18 2024, 3:54 AM
tomek added inline comments.
lib/handlers/user-infos-handler.react.js
171–173 ↗(On Diff #45276)

Sounds risky. After the request timed out, the next request would be more expensive, which is going to increase the service's load. When a service is overloaded, we're going to make it worse.

This revision is now accepted and ready to land.Mon, Oct 21, 3:52 AM
lib/handlers/user-infos-handler.react.js
171–173 ↗(On Diff #45276)

Talked about this offline and concluded that this should be left.
This handler makes sure to request every user exactly once. But if a timeout occurred it's as if we didn't really query fort them.
Moreover, deleting all usersWithMissingDeviceList from deviceListIDsToRemove doesn't result in an immediate request to identity. They will simply be queried for the next time this effect is run.