From e3d1e41cc125ff22587b71c96b764eccc4e1ad7d Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Thu, 18 Feb 2021 09:02:21 -0800 Subject: [PATCH] Dedupe errors when sending Summary: Keeps a small ring buffer of errors we're sending and checks if they're tracked. I'm sure there's a better data structure for this out there were we could have O(1) membership checks, but since we're not keeping that many errors to begin with and we're saving a lot of CPU that would go into sending the errors to Scribe, this should be a net positive. Reviewed By: mweststrate Differential Revision: D26488825 fbshipit-source-id: fdcf58e88d43864852c13e4741a7ab620d596094 --- desktop/app/package.json | 3 ++- desktop/yarn.lock | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/desktop/app/package.json b/desktop/app/package.json index 5bc73db84..4c1f5e1c6 100644 --- a/desktop/app/package.json +++ b/desktop/app/package.json @@ -71,7 +71,8 @@ "uuid": "^8.3.2", "which": "^2.0.1", "ws": "^7.4.2", - "xdg-basedir": "^4.0.0" + "xdg-basedir": "^4.0.0", + "cbuffer": "^2.2.0" }, "optionalDependencies": { "7zip-bin-mac": "^1.0.1" diff --git a/desktop/yarn.lock b/desktop/yarn.lock index 69e89ea4f..e4963c50d 100644 --- a/desktop/yarn.lock +++ b/desktop/yarn.lock @@ -3966,6 +3966,11 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= +cbuffer@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cbuffer/-/cbuffer-2.2.0.tgz#b4c9c9e6f35442b245fd601742509de392a8999f" + integrity sha512-+9554Nki5QIQs3XUaU92/kl/nP+SiSfmkuic5HzH7j2IitLj+DN1YsVmuZlgXDX/vrqG5kEaRr3rnkFxU9UxlA== + chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"