HomePhabricator
Diffusion Comm 3f70a493979b

[keyserver] Ignore promise rejections from websocket message handler

Description

[keyserver] Ignore promise rejections from websocket message handler

Summary:
The unused-promise Lint identified an issue here. onMessage can reject, in which case it doesn't appear to be handled.

To make sure it wasn't handled, I investigated how the redis library handles it. Internally that library extends Node's built-in EventEmitter, and that library explains how it handles things here. Since captureRejections: true is not set by the redis library, that means promise rejections will crash keyserver.

To avoid that, in this diff I wrap the call with ignorePromiseRejections. The conditional is necessary because onMessageCallback returns void | Promise<void>.

Depends on D10182

Test Plan: Flow

Reviewers: michal

Reviewed By: michal

Subscribers: tomek

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

Details

Provenance
ashoatAuthored on Dec 4 2023, 12:45 PM
Reviewer
michal
Differential Revision
D10183: [keyserver] Ignore promise rejections from websocket message handler
Parents
rCOMM1277963cf3de: [keyserver] Ignore promise rejections from state check mechanism
Branches
Unknown
Tags
Unknown