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:
committed by
Facebook GitHub Bot
parent
14c0a7965e
commit
2d948fe4f4
@@ -46,12 +46,14 @@ export default async (store: Store, logger: Logger) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
server.on('notification', ({type, title, description}) => {
|
server.on('notification', ({type, title, description}) => {
|
||||||
console.warn(`[$type] ${title}: ${description}`);
|
const text = `[$type] ${title}: ${description}`;
|
||||||
|
console.warn(text);
|
||||||
notification.open({
|
notification.open({
|
||||||
message: title,
|
message: title,
|
||||||
description: description,
|
description: description,
|
||||||
type: type,
|
type: type,
|
||||||
duration: 0,
|
duration: 0,
|
||||||
|
key: text,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user