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
This commit is contained in:
John Knox
2021-11-19 06:55:25 -08:00
committed by Facebook GitHub Bot
parent 14c0a7965e
commit 2d948fe4f4

View File

@@ -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,
});
});