HomePhabricator
Diffusion Comm 5c38457d4dbb

[keyserver] Avoid "WebSocket is not open" error

Description

[keyserver] Avoid "WebSocket is not open" error

Summary:
Linear issue: ENG-5177

This error is not really causing any problems. That said, its appearance can be considered a regression caused by D9298.

Before that diff, the check on this.ws.readyState at the start of sendMessage prevented the error. After that diff, there was a possibility of this.ws.readyState changing after the compression step.

This diff addresses the regression by introducing a second check after the compression step.

Test Plan: To be honest, this would be fairly expensive to test compared to the cost of making the diff, and the priority of the issue it's addressing. I think the diff is fairly safe... relying on Flow and CI to catch any issues.

Reviewers: atul, michal, kamil

Reviewed By: atul

Subscribers: tomek, wyilio

Differential Revision: https://phab.comm.dev/D9443

Details

Provenance
ashoatAuthored on Oct 10 2023, 6:40 AM
Reviewer
atul
Differential Revision
D9443: [keyserver] Avoid "WebSocket is not open" error
Parents
rCOMM19e5f0ff3d84: Send all notifications received by backgrounded app to JS at once
Branches
Unknown
Tags
Unknown