Page MenuHomePhabricator

[backup] Implement basic websocket
ClosedPublic

Authored by michal on Dec 22 2023, 7:51 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jul 4, 8:32 PM
Unknown Object (File)
Sun, Jun 30, 4:06 PM
Unknown Object (File)
Sun, Jun 30, 8:14 AM
Unknown Object (File)
Wed, Jun 26, 9:24 PM
Unknown Object (File)
Wed, Jun 26, 4:10 PM
Unknown Object (File)
Tue, Jun 25, 6:22 PM
Unknown Object (File)
Tue, Jun 25, 1:22 PM
Unknown Object (File)
Tue, Jun 25, 8:24 AM
Subscribers

Details

Summary

ENG-5329, ENG-5330

This is the basic websocket setup that will be used for adding download/upload log requests. It will be expanded it the future diffs.

Depends on D10452

Test Plan
  • made a new websocket connection
  • tested if responding to pings with pongs kept the socket alive
  • tested sending a binary message and checking if we got it back

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

services/backup/src/http/handlers/log.rs
104–135 ↗(On Diff #34990)

This is implemented based on one of the actix examples. I had trouble testing this behaviour, I think this is more of an implementation detail for web socket clients (e.g. I've read that chrome sometimes sends them). They weren't sent with my testing with tungstenite. Not sure if I should leave them or remove this code and just return an error.

bartek added inline comments.
services/backup/src/http/handlers/log.rs
40 ↗(On Diff #34990)

I prefer this

103 ↗(On Diff #34990)
104–135 ↗(On Diff #34990)

I'd leave it as is and just add a comment above

This revision is now accepted and ready to land.Jan 5 2024, 12:27 AM
This revision was landed with ongoing or failed builds.Jan 8 2024, 7:20 AM
This revision was automatically updated to reflect the committed changes.