mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-04 03:56:33 +08:00
[local-sync] Never show red box on retryable errors
Summary: Given that we were marking the account as errored if we've encountered enough RetryableErrors, we would show the red box to the user when in fact the problem was the user was offline, causing confusion If the user is offline, we will constantly get RetryableErrors in the sync loop, and we can't mark the account as errored in that case. Test Plan: manual Reviewers: evan Reviewed By: evan Differential Revision: https://phab.nylas.com/D3752
This commit is contained in:
parent
5025dbe080
commit
0a12608971
1 changed files with 1 additions and 5 deletions
|
@ -273,14 +273,10 @@ class SyncWorker {
|
||||||
|
|
||||||
// Don't save the error to the account if it was a network/retryable error
|
// Don't save the error to the account if it was a network/retryable error
|
||||||
// /and/ if we haven't retried too many times.
|
// /and/ if we haven't retried too many times.
|
||||||
// If we've retried enough times and still can't get it to work,
|
|
||||||
// we do want to save the error to show it the user that there is an error
|
|
||||||
if (error instanceof IMAPErrors.RetryableError) {
|
if (error instanceof IMAPErrors.RetryableError) {
|
||||||
this._numRetries += 1;
|
this._numRetries += 1;
|
||||||
if (this._numRetries <= 3) {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const isAuthError = error instanceof IMAPErrors.IMAPAuthenticationError
|
const isAuthError = error instanceof IMAPErrors.IMAPAuthenticationError
|
||||||
const accountSyncState = isAuthError ? SYNC_STATE_AUTH_FAILED : SYNC_STATE_ERROR;
|
const accountSyncState = isAuthError ? SYNC_STATE_AUTH_FAILED : SYNC_STATE_ERROR;
|
||||||
|
|
Loading…
Reference in a new issue