Skip to content

Commit

Permalink
[client-app] Rate limit database malformed error reports to sentry
Browse files Browse the repository at this point in the history
Summary:
We were reporting 1m+ of these events, heavily contributing towards our
quota

Test Plan: manual

Reviewers: halla, mark

Reviewed By: halla, mark

Differential Revision: https://phab.nylas.com/D4406
  • Loading branch information
jstejada committed Apr 11, 2017
1 parent 58d2274 commit 8d9b247
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/client-app/src/flux/stores/database-store.es6
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,13 @@ class DatabaseStore extends NylasStore {
// Some errors require action before the query can be retried
if ((new RegExp(malformedStr, 'i')).test(errString)) {
// This is unrecoverable. We have to do a full database reset
NylasEnv.reportError(err)
const fingerprint = ["{{ default }}", "database malformed", err.message];
NylasEnv.reportError(err, {fingerprint,
rateLimit: {
ratePerHour: 30,
key: `DatabaseStore:_executeLocally:${err.message}`,
},
})
Actions.resetEmailCache()
} else if ((new RegExp(schemaChangedStr, 'i')).test(errString)) {
this._preparedStatementCache.del(query);
Expand Down

0 comments on commit 8d9b247

Please sign in to comment.