mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 08:16:09 +08:00
fix(accounts) Don't report error when removing accounts
Summary: The current error condition check is to make sure that accounts are exclusively removed via `Actions.removeAccount`. However, when removing accounts, the in-memory `AccoutStore`s in each window are kept in sync via listening to the config, as opposed to dispatching Actions globally between windows (Actions.removeAccount is scoped to a single window, see actions.es6). So, when we remove an account in one window, config.json will change, and the other windows will always encounter `removedIds.length > 0` to be true when their `_loadAccounts` runs. This will only generate unecessary noise in Sentry. Test Plan: manual Reviewers: mark, evan Reviewed By: evan Differential Revision: https://phab.nylas.com/D3902
This commit is contained in:
parent
a49f5b4a7d
commit
b0e21b5381
2
src/K2
2
src/K2
|
@ -1 +1 @@
|
|||
Subproject commit b55d117216ffc0902266fba8f12aa4b20f467400
|
||||
Subproject commit 6319ce90328b02845efa8c50a9317ef3ac818360
|
|
@ -76,11 +76,6 @@ class AccountStore extends NylasStore {
|
|||
const addedAccountIds = _.difference(accountIds, oldAccountIds);
|
||||
const addedAccounts = _.filter(this._accounts, (a) => addedAccountIds.includes(a.id));
|
||||
|
||||
const removedAccountIds = _.difference(oldAccountIds, accountIds);
|
||||
if (removedAccountIds.length > 0) {
|
||||
NylasEnv.reportError(new Error('_loadAccounts encountered Accounts that should have already been removed'));
|
||||
}
|
||||
|
||||
// Run a few checks on account consistency. We want to display useful error
|
||||
// messages and these can result in very strange exceptions downstream otherwise.
|
||||
this._enforceAccountsValidity()
|
||||
|
|
Loading…
Reference in a new issue