From 5515b274993d26eb3eabe2170400f8adc5b7bb10 Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Tue, 23 Aug 2022 09:46:29 -0700 Subject: [PATCH] Fix importing large Flipper exports Reviewed By: lblasa Differential Revision: D38945105 fbshipit-source-id: ba78ccfc82b65013b79c6c962de7bdef5ae41a60 --- desktop/app/src/init.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/desktop/app/src/init.tsx b/desktop/app/src/init.tsx index 002ba5027..dbd76b8e0 100644 --- a/desktop/app/src/init.tsx +++ b/desktop/app/src/init.tsx @@ -75,7 +75,13 @@ async function getKeytarModule(staticPath: string): Promise { async function getExternalServer(path: string) { const options = { - WebSocket: WS, + WebSocket: class WSWithUnixDomainSocketSupport extends WS { + constructor(url: string, protocols: string | string[]) { + // Flipper exports could be large, and we snd them over the wire + // Setting this limit fairly high (1GB) to allow any reasonable Flipper export to be loaded + super(url, protocols, {maxPayload: 1024 * 1024 * 1024}); + } + }, }; const socket = new ReconnectingWebSocket(`ws+unix://${path}`, [], options); const server = await createFlipperServerWithSocket(