Page MenuHomePhabricator

[lib] Add timeout to useWaitForConnection() hook
ClosedPublic

Authored by angelika on Tue, Jan 7, 5:43 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jan 21, 7:13 AM
Unknown Object (File)
Sat, Jan 18, 8:59 PM
Unknown Object (File)
Sat, Jan 18, 6:09 PM
Unknown Object (File)
Sat, Jan 18, 4:33 AM
Unknown Object (File)
Sat, Jan 18, 4:11 AM
Unknown Object (File)
Fri, Jan 17, 9:58 PM
Unknown Object (File)
Fri, Jan 17, 9:18 AM
Unknown Object (File)
Fri, Jan 17, 7:50 AM
Subscribers

Details

Summary

As per discussion here: https://phab.comm.dev/D14167 added a timeout when waiting for connection. If timeout is hit, an error is thrown.

Depends on D14167

Test Plan
  1. Have mobile and web clients that do not know each other
  2. Put a sleep() call before connecting to tunnelbroker socket (for example 20s)
  3. Close web client
  4. Send a DM on mobile to web. Make sure it's sent (checkmark)
  5. Open web client
  6. Quickly (before sleep from step 2 ends) add mobile to friends (with Settings -> friends -> add friends)

If we do it quickly enough the 5s timeout should trigger.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lib/hooks/wait-for-connection.js
19–20 ↗(On Diff #46603)

Should these be combined?

tomek added inline comments.
lib/hooks/wait-for-connection.js
19–20 ↗(On Diff #46603)
This revision is now accepted and ready to land.Wed, Jan 8, 2:53 AM
lib/hooks/wait-for-connection.js
20 ↗(On Diff #46632)

We should always prefer read-only unless we have a reason to make it writeable