@social-mail/social-mail-web-server 1.4.736 → 1.4.738
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.
- package/dist/server/workflows/repair/counts/RepairEmailCountsWorkflow.js +3 -3
- package/dist/server/workflows/repair/counts/RepairEmailCountsWorkflow.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/server/workflows/repair/counts/RepairEmailCountsWorkflow.ts +3 -3
package/package.json
CHANGED
|
@@ -65,14 +65,14 @@ export default class RepairEmailCountsWorkflow extends Workflow<{ mailboxID? }>
|
|
|
65
65
|
}
|
|
66
66
|
for (const iterator of list) {
|
|
67
67
|
const { emailID } = iterator ;
|
|
68
|
+
start = emailID;
|
|
68
69
|
const lastReply = await db.emails.where(iterator, (p) => (x) => x.threadID === p.emailID)
|
|
69
70
|
.orderByDescending(void 0, (p) => (x) => x.emailID)
|
|
70
71
|
.first();
|
|
71
|
-
const lastReplyID = lastReply?.emailID;
|
|
72
|
+
const lastReplyID = lastReply?.emailID ?? null;
|
|
72
73
|
if (lastReplyID !== iterator.lastReplyID) {
|
|
73
74
|
await db.emails.statements.update({ lastReplyID }, { emailID });
|
|
74
75
|
}
|
|
75
|
-
start = emailID;
|
|
76
76
|
}
|
|
77
77
|
return start;
|
|
78
78
|
}
|
|
@@ -98,6 +98,7 @@ export default class RepairEmailCountsWorkflow extends Workflow<{ mailboxID? }>
|
|
|
98
98
|
}
|
|
99
99
|
for (const iterator of list) {
|
|
100
100
|
const { mailboxID, emailAddressID, autoClose, blocked } = iterator;
|
|
101
|
+
start = mailboxID;
|
|
101
102
|
if (autoClose || blocked) {
|
|
102
103
|
await db.mailboxContacts.statements.update({
|
|
103
104
|
totalThreads: 0,
|
|
@@ -115,7 +116,6 @@ export default class RepairEmailCountsWorkflow extends Workflow<{ mailboxID? }>
|
|
|
115
116
|
openThreads: x.lastReplyID === null ? 1 : 0
|
|
116
117
|
}));
|
|
117
118
|
await db.mailboxContacts.statements.update(all, { mailboxID, emailAddressID});
|
|
118
|
-
start = mailboxID;
|
|
119
119
|
}
|
|
120
120
|
return start;
|
|
121
121
|
}
|