emailengine-app 2.72.3 → 2.72.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ // Shared capped exponential backoff counter for IMAP reconnection scheduling.
4
+ // Pure delay math - the consumers own the timers and decide when a setup
5
+ // counts as validated (reset()).
6
+
7
+ // Exponent clamp so the intermediate float can not blow up on a long outage;
8
+ // with the delay cap applied the clamp itself never changes the resulting
9
+ // delay for the parameter sets in use
10
+ const MAX_ATTEMPT_EXPONENT = 10;
11
+
12
+ class ReconnectBackoff {
13
+ constructor(opts) {
14
+ opts = opts || {};
15
+ this.baseDelay = opts.baseDelay || 2000; // first computed delay (before jitter)
16
+ this.maxDelay = opts.maxDelay || 30000;
17
+ this.factor = opts.factor || 1.5;
18
+ this.jitter = opts.jitter || 0; // random 0..jitter ms added after the cap
19
+ this.attempts = 0;
20
+ }
21
+
22
+ /**
23
+ * Returns the next scheduling delay and increments the attempt counter:
24
+ * min(maxDelay, baseDelay * factor^attempts) plus random jitter
25
+ * @returns {number} Delay in milliseconds
26
+ */
27
+ nextDelay() {
28
+ const delay = Math.min(this.maxDelay, this.baseDelay * Math.pow(this.factor, Math.min(this.attempts, MAX_ATTEMPT_EXPONENT)));
29
+ this.attempts++;
30
+ return this.jitter ? delay + Math.random() * this.jitter : delay;
31
+ }
32
+
33
+ reset() {
34
+ this.attempts = 0;
35
+ }
36
+ }
37
+
38
+ module.exports = { ReconnectBackoff };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emailengine-app",
3
- "version": "2.72.3",
3
+ "version": "2.72.4",
4
4
  "private": false,
5
5
  "productTitle": "EmailEngine",
6
6
  "description": "Email Sync Engine",
@@ -47,8 +47,8 @@
47
47
  },
48
48
  "homepage": "https://emailengine.app/",
49
49
  "dependencies": {
50
- "@bull-board/api": "8.1.0",
51
- "@bull-board/hapi": "8.1.0",
50
+ "@bull-board/api": "8.1.2",
51
+ "@bull-board/hapi": "8.1.2",
52
52
  "@elastic/elasticsearch": "8.15.3",
53
53
  "@hapi/accept": "6.0.3",
54
54
  "@hapi/bell": "13.1.0",
@@ -67,14 +67,14 @@
67
67
  "@postalsys/gettext": "4.1.1",
68
68
  "@postalsys/joi-messages": "1.0.5",
69
69
  "@postalsys/templates": "2.0.1",
70
- "@sentry/node": "10.63.0",
70
+ "@sentry/node": "10.64.0",
71
71
  "@simplewebauthn/browser": "13.3.0",
72
72
  "@simplewebauthn/server": "13.3.2",
73
73
  "@zone-eu/mailsplit": "5.4.14",
74
74
  "@zone-eu/wild-config": "1.7.5",
75
75
  "ace-builds": "1.44.0",
76
76
  "base32.js": "0.1.0",
77
- "bullmq": "5.79.2",
77
+ "bullmq": "5.80.0",
78
78
  "compare-versions": "6.1.1",
79
79
  "dotenv": "17.4.2",
80
80
  "encoding-japanese": "2.2.0",
@@ -88,7 +88,7 @@
88
88
  "html-to-text": "10.0.0",
89
89
  "ical.js": "1.5.0",
90
90
  "iconv-lite": "0.7.3",
91
- "imapflow": "1.4.6",
91
+ "imapflow": "1.4.7",
92
92
  "ioredfour": "1.4.1",
93
93
  "ioredis": "5.11.1",
94
94
  "ipaddr.js": "2.4.0",
@@ -126,13 +126,13 @@
126
126
  "acorn": "8.17.0",
127
127
  "acorn-walk": "8.3.5",
128
128
  "chai": "4.5.0",
129
- "eerawlog": "1.5.3",
129
+ "eerawlog": "1.5.4",
130
130
  "eslint": "10.6.0",
131
131
  "grunt": "1.6.2",
132
132
  "grunt-cli": "1.5.0",
133
133
  "grunt-shell-spawn": "0.5.0",
134
134
  "pino-pretty": "13.1.3",
135
- "prettier": "3.9.4",
135
+ "prettier": "3.9.5",
136
136
  "resedit": "3.0.2",
137
137
  "spdx-satisfies": "6.0.0",
138
138
  "supertest": "7.2.2",