[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:
Juan Tejada 2017-01-20 08:36:12 -08:00
parent 5025dbe080
commit 0a12608971

View file

@ -273,13 +273,9 @@ class SyncWorker {
// Don't save the error to the account if it was a network/retryable error
// /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) {
this._numRetries += 1;
if (this._numRetries <= 3) {
return
}
return
}
const isAuthError = error instanceof IMAPErrors.IMAPAuthenticationError