@novacraft-engineering/mailbox 0.4.30 → 0.4.31
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/lib/mailbox.ts +3 -2
- package/package.json +1 -1
package/lib/mailbox.ts
CHANGED
|
@@ -1222,7 +1222,7 @@ export async function rejudgeStored(options: { before?: string; limit?: number;
|
|
|
1222
1222
|
const before = options.before ?? '9999-12-31'
|
|
1223
1223
|
const rows = await sql`
|
|
1224
1224
|
SELECT id, owner, from_addr, reply_to, subject, body_text, headers, received_at,
|
|
1225
|
-
read, starred, archived, trashed, risk, spam
|
|
1225
|
+
read, starred, archived, trashed, risk, risk_reasons, spam
|
|
1226
1226
|
FROM mail_inbox
|
|
1227
1227
|
WHERE received_at < ${before} AND (${options.flaggedOnly ? 1 : 0} = 0 OR coalesce(risk, 'clean') != 'clean')
|
|
1228
1228
|
ORDER BY received_at DESC
|
|
@@ -1265,7 +1265,8 @@ export async function rejudgeStored(options: { before?: string; limit?: number;
|
|
|
1265
1265
|
// they put it — back-fill may label it, never move it out from under them.
|
|
1266
1266
|
const untouched = !Number(row.read) && !Number(row.starred) && !Number(row.archived) && !Number(row.trashed)
|
|
1267
1267
|
const quarantine = verdict.quarantine && untouched
|
|
1268
|
-
|
|
1268
|
+
const sameReasons = JSON.stringify(parseJson<string[]>(row.risk_reasons, [])) === JSON.stringify(verdict.reasons)
|
|
1269
|
+
if (String(row.risk ?? 'clean') === verdict.risk && Boolean(Number(row.spam)) === quarantine && sameReasons) {
|
|
1269
1270
|
// The verdict is unchanged, but the conversation summary the list reads from may still
|
|
1270
1271
|
// predate it — worth one refresh for the few that carry a warning.
|
|
1271
1272
|
if (verdict.risk !== 'clean') await rethreadAfterChange(String(row.id))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novacraft-engineering/mailbox",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.31",
|
|
4
4
|
"description": "A shared webmail app: one codebase, one deployment per mailbox. Threads, a rich composer with signatures, attachments on S3-compatible storage, sharing links, full-text search, web push and PWA install.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webmail",
|