[client-app] Rate limit error reporting for message processing errors

Summary:
This should prevent us from flooding Sentry with errors like this one:
https://sentry.io/nylas/nylas-mail/issues/230605150/

Test Plan: manual

Reviewers: spang, mark, halla, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D4151
This commit is contained in:
Juan Tejada 2017-03-09 00:11:40 -08:00
parent 521ca86efc
commit 20a05d3340

View file

@ -153,7 +153,12 @@ class MessageProcessor {
desiredParts,
})
const fingerprint = ["{{ default }}", "message processor", err.message];
NylasEnv.reportError(err, {fingerprint: fingerprint})
NylasEnv.reportError(err, {fingerprint,
rateLimit: {
ratePerHour: 30,
key: `MessageProcessorError:${err.message}`,
},
})
// Keep track of uids we failed to fetch
const {failedUIDs = []} = folder.syncState