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
F3520703: D13750.diff
Mon, Dec 23, 1:05 AM
F3519719: D13750.id45296.diff
Sun, Dec 22, 10:45 PM
F3519717: D13750.id45276.diff
Sun, Dec 22, 10:45 PM
F3519699: D13750.id.diff
Sun, Dec 22, 10:45 PM
F3519600: D13750.diff
Sun, Dec 22, 10:43 PM
Unknown Object (File)
Thu, Dec 12, 4:26 AM
Unknown Object (File)
Nov 20 2024, 7:03 AM
Unknown Object (File)
Nov 20 2024, 7:03 AM
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.Oct 21 2024, 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.