Skip to content

Commit

Permalink
fix(fetch): If fetch fails while syncing, then set a warning flag and…
Browse files Browse the repository at this point in the history
… try again
  • Loading branch information
andris9 committed Mar 5, 2024
1 parent 257218d commit ffcb559
Show file tree
Hide file tree
Showing 8 changed files with 224 additions and 101 deletions.
2 changes: 2 additions & 0 deletions lib/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class Account {
counters: accountData.counters,

syncTime: accountData.sync,

lastError:
accountData.state === 'connected' || !accountData.lastErrorState || !Object.keys(accountData.lastErrorState).length
? null
Expand Down Expand Up @@ -228,6 +229,7 @@ class Account {
case 'smtpServerEhlo':
case 'oauth2':
case 'lastErrorState':
case 'syncError':
case 'smtpStatus':
case 'webhookErrorFlag':
try {
Expand Down
295 changes: 201 additions & 94 deletions lib/mailbox.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"start": "node server.js",
"dev": "EE_OPENAPI_VERBOSE=true EENGINE_LOG_RAW=true node --tls-keylog=keylog.txt server --dbs.redis='redis://127.0.0.1:6379/9' --api.port=7003 --api.host=0.0.0.0 | tee $HOME/ee.log.dev.txt | pino-pretty",
"single": "EE_OPENAPI_VERBOSE=true EENGINE_LOG_RAW=true EENGINE_WORKERS=1 node --inspect server --dbs.redis='redis://127.0.0.1:6379/10' --api.port=7003 --api.host=0.0.0.0 | tee $HOME/ee.log.single.txt | pino-pretty",
"single": "EE_OPENAPI_VERBOSE=true EENGINE_LOG_RAW=true EENGINE_WORKERS=1 node --inspect server --dbs.redis='redis://127.0.0.1:6379/10' --api.port=7002 --api.host=0.0.0.0 | tee $HOME/ee.log.single.txt | pino-pretty",
"gmail": "EE_OPENAPI_VERBOSE=true EENGINE_LOG_RAW=true EENGINE_FEATURE_GMAIL_API=true EENGINE_WORKERS=1 node --inspect server --dbs.redis='redis://127.0.0.1:6379/11' --api.port=7003 --api.host=0.0.0.0 | tee $HOME/ee.log.gmail.txt | pino-pretty",
"test": "grunt && node --test test/",
"swagger": "./getswagger.sh",
Expand Down Expand Up @@ -75,7 +75,7 @@
"humanize": "0.0.9",
"ical.js": "1.5.0",
"iconv-lite": "0.6.3",
"imapflow": "1.0.153",
"imapflow": "1.0.154",
"ioredfour": "1.3.0-ioredis-07",
"ioredis": "5.3.2",
"ipaddr.js": "2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion sbom.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions static/licenses.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!doctype html><html><head><meta charset="utf-8"><title>EmailEngine Licenses</title><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous"></head><body>
<div class="container-fluid">
<h1>EmailEngine v2.40.1</h1><p>EmailEngine includes code from the following software packages:</p>
<h1>EmailEngine v2.40.2</h1><p>EmailEngine includes code from the following software packages:</p>
<table class="table table-sm">
<tr><thead class="thead-dark"><th>Package</th><th>Version</th><th>License</th><th>Publisher</th><th>Publisher's Email</th><th>Package URL</th></tr>
<tbody>
Expand Down Expand Up @@ -3835,7 +3835,7 @@ <h1>EmailEngine v2.40.1</h1><p>EmailEngine includes code from the following soft
</tr>
<tr>
<td><a href="https://npmjs.com/package/imapflow">imapflow</a></td>
<td>1.0.153</td>
<td>1.0.154</td>
<td>MIT</td>
<td>Postal Systems O&#xDC;</td>
<td></td>
Expand Down Expand Up @@ -7045,7 +7045,7 @@ <h1>EmailEngine v2.40.1</h1><p>EmailEngine includes code from the following soft
</tr>
<tr>
<td><a href="https://npmjs.com/package/swagger-ui-dist">swagger-ui-dist</a></td>
<td>5.11.8</td>
<td>5.11.9</td>
<td>Apache-2.0</td>
<td></td>
<td></td>
Expand Down
2 changes: 1 addition & 1 deletion translations/messages.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=ascii\n"
"POT-Creation-Date: 2024-03-04 08:36+0000\n"
"POT-Creation-Date: 2024-03-05 11:05+0000\n"

#: views/config/license.hbs:48
msgid "%d day"
Expand Down
13 changes: 13 additions & 0 deletions views/accounts/account.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@
{{/if}}

{{account.stateLabel.name}}</span>

<div>
<div class="text-danger">
{{#if account.syncError}}
Syncing stalled in <em>{{account.syncError.path}}</em>.
{{#if account.syncError.error.responseText}}
{{account.syncError.error.responseText}}
{{else}}
{{account.syncError.error.error}}
{{/if}}
{{/if}}
</div>
</div>
</dd>
{{/if}}

Expand Down
1 change: 1 addition & 0 deletions workers/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2849,6 +2849,7 @@ When making API calls remember that requests against the same account are queued
'oauth2',
'state',
'smtpStatus',
'syncError',
'locale',
'tz'
]) {
Expand Down

0 comments on commit ffcb559

Please sign in to comment.