Page MenuHomePhabricator

[lib] Move `socketPreferredEndpoints` to `httpPreferredEndpoints`
ClosedPublic

Authored by atul on Dec 21 2023, 5:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 30, 3:26 PM
Unknown Object (File)
Apr 4 2024, 12:29 PM
Unknown Object (File)
Apr 4 2024, 12:28 PM
Unknown Object (File)
Mar 12 2024, 9:17 PM
Unknown Object (File)
Mar 12 2024, 9:16 PM
Unknown Object (File)
Mar 12 2024, 9:16 PM
Unknown Object (File)
Mar 12 2024, 9:15 PM
Unknown Object (File)
Feb 9 2024, 11:57 AM
Subscribers
None

Details

Summary

Context is here: https://linear.app/comm/issue/ENG-6134/switch-endpoints-from-socket-to-http

Intentionally leaving socketPreferredEndpoints and accompanying functionality around for the future if we ever want to prefer socket for any of these endpoints. Figure if we have the machinery in place, we can keep it around even if socketPreferredEndpoints is empty for the time being. Let me know if this is an incorrect assumption and I can rip out socketPreferredEndpoints, SocketPreferredEndpoint, etc.

Test Plan

Went through native app connected to prod keyserver and tried to "hit" as many of the endpoints as possible (eg sent messages, created calendar entries, sent image message, created threads, etc) and things continued to work as expected. However, it's worth noting that I haven't yet seen the "disconnected issue" on build 302 yet, so I'm not able to confirm whether this reduces timeouts, etc.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul requested review of this revision.Dec 21 2023, 6:00 PM

Wondering about the impact on the keyserver - if all the clients use HTTP, it might result in a lot of open HTTP connections. Also, from the client's point of view, it might result in a lot of open connections (probably more than a browser allows). So I think we should move only some requests to HTTP, but I might be wrong.

lib/types/endpoints.js
61–62 ↗(On Diff #34949)

Would that make sense for these to be http-only?

I'm not too worried about the amount of HTTP requests. Most of these are called in response to a user action. If it reduces performance and has a negative impact on UX, we can revert it

This revision is now accepted and ready to land.Dec 22 2023, 7:19 AM
lib/types/endpoints.js
61–62 ↗(On Diff #34949)

I think httpOnly is for requests that are only http-capable, whereas these endpoints can be handled over HTTP and WS?