From 2d948fe4f4c2d7e201e12c273e132b1435251597 Mon Sep 17 00:00:00 2001 From: John Knox Date: Fri, 19 Nov 2021 06:55:25 -0800 Subject: [PATCH] Dedupe server error notifications Summary: These notifications, when emit, don't get deduped, so if connection timeouts keep happening, like in [this](https://fb.workplace.com/groups/flippersupport/posts/1257144721432850), then you get tons of notifications. This dedupes them if all the info is the same. Reviewed By: mweststrate Differential Revision: D32560073 fbshipit-source-id: beb4d67e2a97841bb91add7847157176dee4a5f4 --- desktop/flipper-ui-core/src/dispatcher/flipperServer.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/desktop/flipper-ui-core/src/dispatcher/flipperServer.tsx b/desktop/flipper-ui-core/src/dispatcher/flipperServer.tsx index 22cdd9857..b42f70ed4 100644 --- a/desktop/flipper-ui-core/src/dispatcher/flipperServer.tsx +++ b/desktop/flipper-ui-core/src/dispatcher/flipperServer.tsx @@ -46,12 +46,14 @@ export default async (store: Store, logger: Logger) => { }); server.on('notification', ({type, title, description}) => { - console.warn(`[$type] ${title}: ${description}`); + const text = `[$type] ${title}: ${description}`; + console.warn(text); notification.open({ message: title, description: description, type: type, duration: 0, + key: text, }); });