@bobfrankston/rmfmail 1.0.601 → 1.0.605
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/TODO.md +5 -0
- package/client/components/alarms.js +45 -24
- package/client/components/alarms.js.map +1 -1
- package/client/components/alarms.ts +40 -18
- package/docs/push-relay.md +141 -0
- package/package.json +2 -2
- package/packages/mailx-imap/index.d.ts +12 -1
- package/packages/mailx-imap/index.d.ts.map +1 -1
- package/packages/mailx-imap/index.js +63 -9
- package/packages/mailx-imap/index.js.map +1 -1
- package/packages/mailx-imap/index.ts +64 -9
- package/packages/mailx-imap/package-lock.json +2 -2
- package/packages/mailx-imap/package.json +1 -1
- package/packages/mailx-service/index.d.ts.map +1 -1
- package/packages/mailx-service/index.js +17 -5
- package/packages/mailx-service/index.js.map +1 -1
- package/packages/mailx-service/index.ts +15 -5
- package/packages/mailx-store/db.d.ts +22 -0
- package/packages/mailx-store/db.d.ts.map +1 -1
- package/packages/mailx-store/db.js +67 -0
- package/packages/mailx-store/db.js.map +1 -1
- package/packages/mailx-store/db.ts +75 -0
- package/packages/mailx-store/package.json +1 -1
package/TODO.md
CHANGED
|
@@ -213,6 +213,7 @@ Items blocked on a design decision. Short-form question here; full context in th
|
|
|
213
213
|
| **C43** | OPEN | Message list column controls + threading flags. ✓ (sort-by-column-click is small) |
|
|
214
214
|
| **C44** | PARTIAL | Real OS popup windows / pop-out — floating-overlay popout landed (Q64 v1.0.344); real OS processes still blocked on msger custom-protocol fix (C28). **Blocked on msger.** |
|
|
215
215
|
| [**C46**](#ext46) | PARTIAL | Mailto handler split out as [P115](#ext115) (registry-only, not blocked). Remaining (Share target, tray, notifications, MSIX) still blocked on MSIX packaging. |
|
|
216
|
+
| **C127** | OPTIONAL | **Push relay for calendar / mail / tasks** — design at [`docs/push-relay.md`](push-relay.md). New `MailApps/relayer/` package, alerter-shape (single Node Express+ws process, deploy alongside other small services). Generic API: client POSTs `/subscribe` with upstream + params, relay registers the upstream `events.watch` and returns an SSE/WS endpoint the client holds open. Per-upstream adapter files (`google-calendar.ts`, `google-gmail.ts`, `ms-graph-events.ts`); fan-out + replay buffer + subscription store generic. Client side: `pushRelayUrl` + credentials in settings, falls back to syncToken polling when relay unreachable. **Build only when polling latency demonstrably matters** — for typical use, 5–10 s syncToken cadence is functionally instant. Push is a freshness boost, not a correctness fix. |
|
|
216
217
|
|
|
217
218
|
<a id="concerns"></a>
|
|
218
219
|
|
|
@@ -786,6 +787,10 @@ Was part of S1 "local-first reconciliation refactor" until 2026-04-23 when S1's
|
|
|
786
787
|
|
|
787
788
|
| Item | Version |
|
|
788
789
|
|---|---|
|
|
790
|
+
| **Spam / Move: rows no longer reappear after action** — User report 2026-05-09: "select two lines with luxury watches, press the spam button, they go away ... and then they come back." Same root cause as today's trash fix: `MailxService.moveMessages` (and singular `moveMessage`) updated only the legacy `messages.folder_id` column. The user-visible list query joins through `message_folders`; when the next folder-counts event refreshed the list, the mf row still pointed at the source folder so the message reappeared. Fix: both methods now use `db.moveMessageLocal(uid, fromFolderId, toFolderId)` which updates BOTH columns atomically. Spam button and drag-to-folder both use this path. Regression test added in `tests/undelete.test.ts` ("spam regression: marked-as-spam rows don't reappear"). | v1.0.605 |
|
|
791
|
+
| **Reminder popup: collapse Edit+Open into one button, treat post-edit as new entry** — Bob 2026-05-09: "edit/open should be the same — we only need one. After edit it can be treated as a new entry to be reprocessed and rescheduled." Single "Open" button now opens htmlLink, clears the dismissed state for the uuid, and applies a 2-min snooze so the GCal sync window can pick up the edit (from any client — web, phone, another mailx, co-organizer) before the next poll re-evaluates. If the start gets pushed out by an hour, the alarm waits for the new lead time; if pulled in, it re-fires after the 2-min sync window. No carryover from old localStorage state. | v1.0.604 |
|
|
792
|
+
| **Reminder popup: stop auto-re-fire on X-close, add Edit/Open buttons** — Bob 2026-05-09: "Nice to see the calendar popup but it keeps popping up and needs snooze/dismiss/edit/open." Root cause: the `default:` branch in the popup-result switch (covers `closed`/`dismissed`/empty button) called `firedThisSession.delete(item.uuid)` so the next 30 s poll re-showed the same reminder — spam loop. Fix: X-close / Esc / closed-without-pick now auto-snoozes 15 min, matching what the user clearly meant ("not now"). They can dismiss permanently by clicking Dismiss when the snooze expires. Added "Edit" and "Open" buttons for items with htmlLink (calendar events): Open opens the link AND snoozes 15 m (peek), Edit opens the link AND dismisses (engage). Removed "Snooze 5m" (rarely useful) so the new buttons fit. Tasks still get only Snooze/Dismiss (no htmlLink). | v1.0.603 |
|
|
793
|
+
| **Ctrl+Z undelete works (trash = local move, not delete)** — Bob 2026-05-09: "^z is not undeleting the last deletion." Root cause: `trashMessage`/`trashMessages` did `db.deleteMessage(uid)` (wiped row + body file) and queued an IMAP MOVE keyed on the original UID. `undeleteMessage` then queued a counter-MOVE *also* keyed on the original UID — but after the to-trash MOVE drained on the server, the trash-side uid was new, so the counter-MOVE's `fetchByUid` returned null and the action silently dropped. Plus, even if the queue resolved, the local DB had no row to show until the next reconcile. Fix: trash is now a **local move** to the trash folder via new `db.moveMessageLocal(uid, fromFolderId, toFolderId)` — updates BOTH `messages.folder_id` AND the `message_folders` join row, preserving the same uid. The body file stays put. Undelete inverts: move back locally, then either cancel the still-pending to-trash sync action (server never saw the delete) or queue a counter-MOVE that drains as soon as the reconciler has rebound the trash-side uid via Message-ID. New `db.findPendingSyncAction` helper covers the cancel case. Daemon-side regression tests in `tests/undelete.test.ts` cover both branches + uid-preservation + missing-row cases. `tests/dom/` will pick up the keyboard handler when we have a fixture for that. | v1.0.602 |
|
|
789
794
|
| **Viewer scroll preserved across list re-renders** — Bob 2026-05-09: "I click on an entry... but when I go back to the letter preview window it sometimes jumps back to the top as if it were being reactivated anew." Root cause: list rebuilds on every folderCountsChanged / sync event; `restoreSelection()` then calls `focusRow()` on the row whose uid matches, firing `viewerShow()` on the same message that's already showing. The viewer re-paints, `bodyEl.innerHTML = …` destroys the iframe, scroll resets to 0. Fix: same-message guard at the top of `showMessage` — if `currentAccountId === accountId && currentMessage.uid === uid && (folderId matches) && bodyEl has iframe && !isRetry`, refresh the header from the new envelope and bail without touching `bodyEl`. The iframe and its scroll position survive. Retry path (bodyAvailable, transient-error retry, flag-watch banner) bypasses via `isRetry=true`. Caught + verified by new JSDOM client-side test harness (`tests/dom/`); first three tests reproduce the scroll wipe and the cross-message and cross-account negative cases. | v1.0.600 |
|
|
790
795
|
| **JSDOM client-side test harness (tests/dom/)** — new `tests/dom/setup.ts` builds a fresh JSDOM per test with a stub `mailxapi`, a `fireEvent` helper for IDLE/sync subscribers, and per-test global teardown. Catches the class of bugs that manifest in the WebView but not in the daemon: click→render races, send-while-typing, scroll preservation, focus jumps. First three tests cover viewer-scroll preservation; more land as Bob's reports surface. Wired into `npm run test` and `npm run test:fast`. | v1.0.600 |
|
|
791
796
|
| **C123 — Dynamic fast-lane connection (per-account)** — second persistent IMAP client per account (`fastClients` map) lazy-allocated alongside the existing slow-lane `opsClients`. `withConnection` fast tasks queue and drain on the fast client; slow tasks continue on the original ops client. Both lanes drain CONCURRENTLY now (`runningFast` / `runningSlow` independent flags) — click-time body fetch and flag toggle never wait behind a multi-minute prefetch / backfill again. Costs +1 IMAP socket per active account (Bob's bobma: 3 sockets per account = ops + fast + IDLE, well under Dovecot's 20-conn cap). Stale-detect, error-discard, shutdown, disconnectOps all updated to handle both lanes. Ops verbose-IMAP wire trace propagated to the fast lane so click-time wedges show in the log. Replaces the chunking-as-yield-point hack from v1.0.586 (which is still useful but no longer load-bearing). | v1.0.587 |
|
|
@@ -287,38 +287,54 @@ async function showOsPopupForItem(item) {
|
|
|
287
287
|
<div class="when">${escapeHtml(formatWhen(item.whenMs))}</div>
|
|
288
288
|
<div class="kind">${item.kind === "calendar" ? "Calendar event" : "Task due"}</div>
|
|
289
289
|
</body></html>`;
|
|
290
|
-
//
|
|
291
|
-
//
|
|
290
|
+
// Button labels. Open opens the htmlLink (Google Calendar editor)
|
|
291
|
+
// and clears all local alarm state so the next poll tick treats the
|
|
292
|
+
// event as a fresh entry — if the user moves the start time during
|
|
293
|
+
// the edit, the new alarm fires off the new time, not the old one.
|
|
294
|
+
// Tasks have no htmlLink so Open is skipped for them.
|
|
292
295
|
const buttons = [];
|
|
296
|
+
buttons.push("Snooze 15m", "Snooze 1h", "Dismiss");
|
|
293
297
|
if (item.htmlLink)
|
|
294
|
-
buttons.push("Open
|
|
295
|
-
buttons.push("Snooze 5m", "Snooze 15m", "Snooze 1h", "Dismiss");
|
|
298
|
+
buttons.push("Open");
|
|
296
299
|
const r = await showReminderPopup({
|
|
297
300
|
title: item.kind === "calendar" ? "Calendar reminder" : "Task reminder",
|
|
298
301
|
html,
|
|
299
302
|
buttons,
|
|
300
|
-
size: { width:
|
|
303
|
+
size: { width: 480, height: 210 },
|
|
301
304
|
});
|
|
302
305
|
const api = window.mailxapi;
|
|
306
|
+
const openLink = () => {
|
|
307
|
+
if (!item.htmlLink)
|
|
308
|
+
return;
|
|
309
|
+
if (api?.openExternal)
|
|
310
|
+
api.openExternal(item.htmlLink);
|
|
311
|
+
else
|
|
312
|
+
window.open(item.htmlLink, "_blank");
|
|
313
|
+
};
|
|
303
314
|
switch (r.button) {
|
|
304
|
-
case "Open
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
//
|
|
312
|
-
//
|
|
313
|
-
//
|
|
315
|
+
case "Open":
|
|
316
|
+
openLink();
|
|
317
|
+
// After opening for edit, treat the event as a brand-new
|
|
318
|
+
// entry: clear all local alarm state so the next poll tick
|
|
319
|
+
// re-fetches the (possibly edited) event and decides anew
|
|
320
|
+
// whether to alarm. Edits can come from any client (web,
|
|
321
|
+
// phone, another mailx instance, a co-organizer) — we just
|
|
322
|
+
// re-evaluate against the synced data. Pushed start out →
|
|
323
|
+
// alarm waits for the new lead time; pulled in → fires again.
|
|
324
|
+
// No carryover.
|
|
325
|
+
//
|
|
326
|
+
// Brief 2-min snooze gives the calendar sync window to pick
|
|
327
|
+
// up edits before the next alarm pass — without it, the
|
|
328
|
+
// next 30-s poll reads the still-stale local cache and
|
|
329
|
+
// re-fires immediately. After 2 min, re-evaluation is
|
|
330
|
+
// against (hopefully) fresh data.
|
|
314
331
|
{
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
saveDismissed(
|
|
332
|
+
const dm = loadDismissed();
|
|
333
|
+
delete dm[item.uuid];
|
|
334
|
+
saveDismissed(dm);
|
|
318
335
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
snoozeItem(item, 5);
|
|
336
|
+
firedThisSession.delete(item.uuid);
|
|
337
|
+
snoozeItem(item, 2);
|
|
322
338
|
break;
|
|
323
339
|
case "Snooze 15m":
|
|
324
340
|
snoozeItem(item, 15);
|
|
@@ -334,9 +350,14 @@ async function showOsPopupForItem(item) {
|
|
|
334
350
|
}
|
|
335
351
|
break;
|
|
336
352
|
default:
|
|
337
|
-
// User closed the window via X
|
|
338
|
-
//
|
|
339
|
-
|
|
353
|
+
// User closed the window via X / Esc / "closed" / "dismissed"
|
|
354
|
+
// without picking a labeled button. Treat as a 15-minute
|
|
355
|
+
// snooze: the user clearly doesn't want to act right now,
|
|
356
|
+
// and re-firing every 30 s spams them. They can still
|
|
357
|
+
// dismiss permanently by clicking Dismiss when the snooze
|
|
358
|
+
// expires. Pre-fix this branch deleted from firedThisSession
|
|
359
|
+
// which caused the "popup keeps coming back" symptom.
|
|
360
|
+
snoozeItem(item, 15);
|
|
340
361
|
break;
|
|
341
362
|
}
|
|
342
363
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alarms.js","sourceRoot":"","sources":["alarms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEtF,MAAM,aAAa,GAAG,uBAAuB,CAAC,CAAM,iBAAiB;AACrE,MAAM,WAAW,GAAG,qBAAqB,CAAC,CAAU,yBA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,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC/C,IAAI,CAAC,QAAQ,CAAC,MAAM;YAAE,UAAU,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAS,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -271,41 +271,63 @@ async function showOsPopupForItem(item: AlarmItem): Promise<void> {
|
|
|
271
271
|
<div class="kind">${item.kind === "calendar" ? "Calendar event" : "Task due"}</div>
|
|
272
272
|
</body></html>`;
|
|
273
273
|
|
|
274
|
-
//
|
|
275
|
-
//
|
|
274
|
+
// Button labels. Open opens the htmlLink (Google Calendar editor)
|
|
275
|
+
// and clears all local alarm state so the next poll tick treats the
|
|
276
|
+
// event as a fresh entry — if the user moves the start time during
|
|
277
|
+
// the edit, the new alarm fires off the new time, not the old one.
|
|
278
|
+
// Tasks have no htmlLink so Open is skipped for them.
|
|
276
279
|
const buttons: string[] = [];
|
|
277
|
-
|
|
278
|
-
buttons.push("
|
|
280
|
+
buttons.push("Snooze 15m", "Snooze 1h", "Dismiss");
|
|
281
|
+
if (item.htmlLink) buttons.push("Open");
|
|
279
282
|
|
|
280
283
|
const r = await showReminderPopup({
|
|
281
284
|
title: item.kind === "calendar" ? "Calendar reminder" : "Task reminder",
|
|
282
285
|
html,
|
|
283
286
|
buttons,
|
|
284
|
-
size: { width:
|
|
287
|
+
size: { width: 480, height: 210 },
|
|
285
288
|
});
|
|
286
289
|
|
|
287
290
|
const api = (window as any).mailxapi;
|
|
291
|
+
const openLink = (): void => {
|
|
292
|
+
if (!item.htmlLink) return;
|
|
293
|
+
if (api?.openExternal) api.openExternal(item.htmlLink);
|
|
294
|
+
else window.open(item.htmlLink, "_blank");
|
|
295
|
+
};
|
|
288
296
|
switch (r.button) {
|
|
289
|
-
case "Open
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
//
|
|
295
|
-
//
|
|
296
|
-
//
|
|
297
|
-
|
|
297
|
+
case "Open":
|
|
298
|
+
openLink();
|
|
299
|
+
// After opening for edit, treat the event as a brand-new
|
|
300
|
+
// entry: clear all local alarm state so the next poll tick
|
|
301
|
+
// re-fetches the (possibly edited) event and decides anew
|
|
302
|
+
// whether to alarm. Edits can come from any client (web,
|
|
303
|
+
// phone, another mailx instance, a co-organizer) — we just
|
|
304
|
+
// re-evaluate against the synced data. Pushed start out →
|
|
305
|
+
// alarm waits for the new lead time; pulled in → fires again.
|
|
306
|
+
// No carryover.
|
|
307
|
+
//
|
|
308
|
+
// Brief 2-min snooze gives the calendar sync window to pick
|
|
309
|
+
// up edits before the next alarm pass — without it, the
|
|
310
|
+
// next 30-s poll reads the still-stale local cache and
|
|
311
|
+
// re-fires immediately. After 2 min, re-evaluation is
|
|
312
|
+
// against (hopefully) fresh data.
|
|
313
|
+
{ const dm = loadDismissed(); delete dm[item.uuid]; saveDismissed(dm); }
|
|
314
|
+
firedThisSession.delete(item.uuid);
|
|
315
|
+
snoozeItem(item, 2);
|
|
298
316
|
break;
|
|
299
|
-
case "Snooze 5m": snoozeItem(item, 5); break;
|
|
300
317
|
case "Snooze 15m": snoozeItem(item, 15); break;
|
|
301
318
|
case "Snooze 1h": snoozeItem(item, 60); break;
|
|
302
319
|
case "Dismiss":
|
|
303
320
|
{ const m = loadDismissed(); m[item.uuid] = true; saveDismissed(m); }
|
|
304
321
|
break;
|
|
305
322
|
default:
|
|
306
|
-
// User closed the window via X
|
|
307
|
-
//
|
|
308
|
-
|
|
323
|
+
// User closed the window via X / Esc / "closed" / "dismissed"
|
|
324
|
+
// without picking a labeled button. Treat as a 15-minute
|
|
325
|
+
// snooze: the user clearly doesn't want to act right now,
|
|
326
|
+
// and re-firing every 30 s spams them. They can still
|
|
327
|
+
// dismiss permanently by clicking Dismiss when the snooze
|
|
328
|
+
// expires. Pre-fix this branch deleted from firedThisSession
|
|
329
|
+
// which caused the "popup keeps coming back" symptom.
|
|
330
|
+
snoozeItem(item, 15);
|
|
309
331
|
break;
|
|
310
332
|
}
|
|
311
333
|
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Push Relay (C127, optional)
|
|
2
|
+
|
|
3
|
+
Status: design only — not yet built. Relevant when polling latency feels too slow OR when battery / quota matters more than now.
|
|
4
|
+
|
|
5
|
+
## Problem
|
|
6
|
+
|
|
7
|
+
mailx polls Google Calendar / Gmail / Outlook for changes. Polling is cheap, simple, and works on every network — the right default. But it has two costs:
|
|
8
|
+
|
|
9
|
+
1. **Latency floor.** Even at a 5 s syncToken cadence, "the user just rescheduled this on their phone" takes ~5 s to surface in mailx. For most workflows that's invisible; for "alarm fires for an event that was moved an hour ago" it isn't.
|
|
10
|
+
2. **Battery / quota on mobile.** The Android shell polls the same way the desktop does; on a phone that's measurable wakeups.
|
|
11
|
+
|
|
12
|
+
Push notifications (Google's `events.watch`, Microsoft Graph webhook subscriptions, Gmail's `users.watch`) fix both, but only deliver to a public HTTPS URL. The desktop client doesn't have one. So we need a relay.
|
|
13
|
+
|
|
14
|
+
## Shape
|
|
15
|
+
|
|
16
|
+
A standalone Node service in `MailApps/relayer/`, deployed wherever the operator runs other small services (alerter-style: tiny Express app, one config file, one long-running process). One relay process serves multiple users; per-user state is keyed by user-issued tokens.
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
┌──────────────┐ watch ┌─────────┐ webhook ┌───────────┐ WS/SSE ┌────────┐
|
|
20
|
+
│ Google / MS │ ──register── │ relayer │ ◀──────── │ relayer │ ◀────────│ rmfmail│
|
|
21
|
+
│ Calendar API │ │ /sub │ │ /hook/:id │ │ client │
|
|
22
|
+
└──────────────┘ └─────────┘ └───────────┘ └────────┘
|
|
23
|
+
▲ │ ▲
|
|
24
|
+
│ events.watch( │ per-subscription state: │
|
|
25
|
+
│ address: relayer/hook │ upstream channel id, expiry, owner-token, │
|
|
26
|
+
│ token: per-sub secret │ fan-out endpoints │
|
|
27
|
+
│ ) │ │
|
|
28
|
+
└──── done by relayer on │ │
|
|
29
|
+
client request, with │ │
|
|
30
|
+
client-supplied OAuth │ │
|
|
31
|
+
access token (kept │ │
|
|
32
|
+
short-lived; client │ │
|
|
33
|
+
re-presents on │ │
|
|
34
|
+
renewal) │ │
|
|
35
|
+
▼
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Three roles, separable:
|
|
39
|
+
- **Subscriber API** — clients POST to register what they want watched.
|
|
40
|
+
- **Hook receiver** — public endpoint(s) the upstream services post to.
|
|
41
|
+
- **Fan-out** — per-subscription WS or SSE that holds open client connections and pushes payloads.
|
|
42
|
+
|
|
43
|
+
## API (relayer side)
|
|
44
|
+
|
|
45
|
+
Generic relay shape — caller specifies upstream service + the params that service needs to register a watch. The relay knows enough about each supported upstream to issue the watch-registration call and decode the inbound webhook envelope; it doesn't introspect payload content.
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
POST /subscribe
|
|
49
|
+
body: {
|
|
50
|
+
upstream: "google-calendar" | "google-gmail" | "ms-graph-events" | …
|
|
51
|
+
params: { …upstream-specific watch args, e.g. calendarId, accessToken, expiry preference }
|
|
52
|
+
deliver: "sse" | "ws"
|
|
53
|
+
}
|
|
54
|
+
→ 200 {
|
|
55
|
+
subscriptionId: "<uuid>",
|
|
56
|
+
deliverUrl: "/sub/<uuid>", // open SSE / WS here
|
|
57
|
+
authToken: "<random-secret>", // present on connect
|
|
58
|
+
expiresAt: <ms> // when relay's upstream channel needs renewal
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
POST /subscribe/<id>/renew
|
|
62
|
+
body: { params: { accessToken: "<fresh OAuth>" } }
|
|
63
|
+
→ 200 { expiresAt: <ms> }
|
|
64
|
+
|
|
65
|
+
DELETE /subscribe/<id>
|
|
66
|
+
→ 204 (also calls upstream stop-watch)
|
|
67
|
+
|
|
68
|
+
GET /subscribe/<id>/status
|
|
69
|
+
→ 200 { upstream, expiresAt, lastEventAt, queueDepth }
|
|
70
|
+
|
|
71
|
+
GET /sub/<id> (SSE) — emits `data: {payload}\n\n` per upstream event
|
|
72
|
+
(or WS upgrade) — same payload shape as text frames
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Auth: `Authorization: Bearer <authToken>` on every call after `/subscribe`. The token issued at subscribe time scopes the subscription; one client manages one or more subscriptions, each with its own token.
|
|
76
|
+
|
|
77
|
+
## API (client side)
|
|
78
|
+
|
|
79
|
+
Two settings the user fills in:
|
|
80
|
+
- `pushRelayUrl` — e.g. `https://mail1.example.com:NNNN`
|
|
81
|
+
- `pushRelayCredentials` — issued by the operator at first contact (one-time, opaque blob; relay verifies)
|
|
82
|
+
|
|
83
|
+
When `pushRelayUrl` is non-empty, the client at startup:
|
|
84
|
+
1. Reads its previous subscription IDs from local config.
|
|
85
|
+
2. For each, opens the SSE / WS connection.
|
|
86
|
+
3. If the connection refuses with "unknown subscription" (relay restart, expiry), re-subscribes from scratch with the current OAuth token and stores the new id.
|
|
87
|
+
4. Hooks the inbound event stream into the same `mailxapi.onEvent` channel the daemon already uses, so the alarm subsystem / message-list / folder-tree all consume push events the same way they consume the daemon's IDLE / sync events.
|
|
88
|
+
|
|
89
|
+
The client owns OAuth tokens; the relay receives short-lived access tokens at register / renew time, doesn't store refresh tokens.
|
|
90
|
+
|
|
91
|
+
## Reliability
|
|
92
|
+
|
|
93
|
+
- **Replay queue per subscription** — last N events (in-memory ring, e.g. N=100) so a brief disconnect doesn't lose events. Client passes `Last-Event-ID` (SSE) or a sequence cursor (WS) on reconnect.
|
|
94
|
+
- **Channel renewal** — relay tracks each upstream channel's expiry, schedules renewal at 80% of TTL, calls back to the client (via the WS/SSE itself) for a fresh OAuth token if needed.
|
|
95
|
+
- **Fail-open** — if the relay is unreachable, the client's existing syncToken polling continues. Push is "freshness boost," never load-bearing for correctness.
|
|
96
|
+
|
|
97
|
+
## Generic relay vs per-upstream code
|
|
98
|
+
|
|
99
|
+
The relay needs per-upstream code for:
|
|
100
|
+
- How to register a watch (the API call shape varies).
|
|
101
|
+
- How to decode the inbound webhook envelope (Google sends headers in `X-Goog-*`, Graph sends a JSON body, etc.).
|
|
102
|
+
- How to renew or stop a watch.
|
|
103
|
+
|
|
104
|
+
Per-upstream is a small adapter (~50–100 lines each). Adding "Outlook Tasks" or "iCloud Calendar" later is a new file in `relayer/upstreams/`. The fan-out, subscription store, WS/SSE plumbing, replay buffer — all generic, written once.
|
|
105
|
+
|
|
106
|
+
## Operator footprint
|
|
107
|
+
|
|
108
|
+
- One Node process, one port, one HTTPS cert (or behind a reverse proxy that handles TLS).
|
|
109
|
+
- Storage: SQLite or JSON for the subscription map (small — one row per active subscription).
|
|
110
|
+
- Logs to a file the operator already tails.
|
|
111
|
+
- No queue infrastructure, no message broker, no DB cluster.
|
|
112
|
+
|
|
113
|
+
This is the same operational shape as alerter — drop into `MailApps/`, deploy alongside other small services, treat as one more daemon.
|
|
114
|
+
|
|
115
|
+
## When to build this
|
|
116
|
+
|
|
117
|
+
Only when polling demonstrably isn't fast enough, OR when mobile battery becomes a real concern (push lets the Android shell wake on event instead of polling on a timer). Polling at 5–10 s syncToken cadence is functionally instant for the "user rescheduled an event" case and quota-cheap. Push is a freshness optimization, not a correctness fix.
|
|
118
|
+
|
|
119
|
+
## Alternatives considered
|
|
120
|
+
|
|
121
|
+
- **Cloudflare Workers + Durable Objects** — cleaner per-user-isolation story but requires each user to deploy their own Worker (or one shared operator-run Worker, with a different trust shape). Higher onboarding friction; users without a CF account can't use it. Pro: free tier, edge latency. Con: vendor lock-in, two-click onboarding minimum (account + token).
|
|
122
|
+
- **Cloudflare Tunnel / ngrok to the local daemon** — no relay needed, the daemon exposes its own webhook receiver. Catch: only works while the daemon is running; events while offline are lost (recovered by the next syncToken poll, which already exists). Per-instance tunnel.
|
|
123
|
+
- **Status quo (poll only)** — what mailx does today. Right default; this doc is for when "default isn't enough."
|
|
124
|
+
|
|
125
|
+
## Files (when built)
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
MailApps/relayer/
|
|
129
|
+
package.json
|
|
130
|
+
tsconfig.json
|
|
131
|
+
index.ts — Express server + WS upgrade + SSE
|
|
132
|
+
upstreams/
|
|
133
|
+
google-calendar.ts
|
|
134
|
+
google-gmail.ts
|
|
135
|
+
ms-graph-events.ts
|
|
136
|
+
subs.ts — subscription store (SQLite)
|
|
137
|
+
fanout.ts — per-sub connection pool + replay buffer
|
|
138
|
+
readme.md — operator doc (deploy + config)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Client side: extend `mailx-service` with a `pushRelayClient.ts` that opens / re-opens / re-subscribes; surface its status in the existing sync-status banner.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobfrankston/rmfmail",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.605",
|
|
4
4
|
"description": "Local-first email client with IMAP sync and standalone native app",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "bin/mailx.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"start:prod": "node packages/mailx-server/index.js",
|
|
30
30
|
"release": "npmglobalize",
|
|
31
31
|
"test": "node --experimental-strip-types --test tests/*.test.ts tests/dom/*.test.ts",
|
|
32
|
-
"test:fast": "node --experimental-strip-types --test tests/dedup.test.ts tests/dedup-newest.test.ts tests/dupcount.test.ts tests/search.test.ts tests/sync-coalesce.test.ts tests/dom/_smoke.test.ts tests/dom/viewer-scroll.test.ts tests/dom/viewer-rerender-guard.test.ts",
|
|
32
|
+
"test:fast": "node --experimental-strip-types --test tests/dedup.test.ts tests/dedup-newest.test.ts tests/dupcount.test.ts tests/search.test.ts tests/sync-coalesce.test.ts tests/undelete.test.ts tests/dom/_smoke.test.ts tests/dom/viewer-scroll.test.ts tests/dom/viewer-rerender-guard.test.ts",
|
|
33
33
|
"postinstall": "node bin/postinstall.js"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
@@ -398,7 +398,18 @@ export declare class ImapManager extends EventEmitter {
|
|
|
398
398
|
moveMessage(accountId: string, uid: number, fromFolderId: number, toFolderId: number): Promise<void>;
|
|
399
399
|
/** Move message across accounts using iflow's moveMessageToServer */
|
|
400
400
|
moveMessageCrossAccount(fromAccountId: string, uid: number, fromFolderId: number, toAccountId: string, toFolderId: number): Promise<void>;
|
|
401
|
-
/** Undelete — move from Trash back to original folder
|
|
401
|
+
/** Undelete — move from Trash back to original folder. Local-first:
|
|
402
|
+
* the row was moved (not deleted) on trash, so we just move it back
|
|
403
|
+
* in the local DB and reconcile the IMAP queue. Two cases:
|
|
404
|
+
* (a) the to-trash MOVE is still pending — cancel it; the server
|
|
405
|
+
* never saw the delete, so no counter-action is needed.
|
|
406
|
+
* (b) the to-trash MOVE drained — the message is now in Trash on
|
|
407
|
+
* the server with a new uid. Queue a counter-move from
|
|
408
|
+
* trash → original. The IMAP processor's fetchByUid in trash
|
|
409
|
+
* will use the local membership uid (which the reconciler
|
|
410
|
+
* rebound to the server's new trash uid via Message-ID match).
|
|
411
|
+
* If reconcile hasn't run yet (unlikely race), action retries
|
|
412
|
+
* until it does. */
|
|
402
413
|
undeleteMessage(accountId: string, uid: number, originalFolderId: number): Promise<void>;
|
|
403
414
|
/** Update flags — local-first, queues IMAP sync */
|
|
404
415
|
updateFlagsLocal(accountId: string, uid: number, folderId: number, flags: string[]): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAgB,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACtG,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAsF3C,yCAAyC;AACzC,MAAM,WAAW,iBAAiB;IAC9B,UAAU,EAAE,CA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;IAEvD,iBAAiB,IAAI,IAAI;IAgDzB,yBAAyB;IACzB,gBAAgB,IAAI,IAAI;IASxB,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,eAAe,CAAwC;IAE/D;;+DAE2D;IAC3D,gBAAgB,IAAI,IAAI;IAwGxB,oCAAoC;IACpC,kBAAkB,IAAI,IAAI;IAa1B;2EACuE;IACvE,OAAO,CAAC,eAAe,CAAsC;IAE7D;yEACqE;YACvD,gBAAgB;IAK9B;;;;;;iDAM6C;IACvC,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;YAU9C,sBAAsB;IAsGpC,2CAA2C;IACrC,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAStC,wCAAwC;IAClC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAelC"}
|
|
@@ -2696,12 +2696,24 @@ export class ImapManager extends EventEmitter {
|
|
|
2696
2696
|
if (messages.length === 0)
|
|
2697
2697
|
return;
|
|
2698
2698
|
const trash = this.findFolder(accountId, "trash");
|
|
2699
|
-
// Local first —
|
|
2699
|
+
// Local first — move to trash folder locally so the row stays
|
|
2700
|
+
// visible in Trash and Ctrl+Z can restore it. Body file stays in
|
|
2701
|
+
// its original folder dir; the next sync rebinds path on
|
|
2702
|
+
// membership uid change. Old behavior was `db.deleteMessage` +
|
|
2703
|
+
// `unlinkBodyFile` which made undelete impossible (no row to
|
|
2704
|
+
// restore, no body to read). For folders that ARE the trash
|
|
2705
|
+
// already, fall through to hard delete (the action will EXPUNGE
|
|
2706
|
+
// and reconciliation cleans up).
|
|
2700
2707
|
for (const msg of messages) {
|
|
2701
|
-
|
|
2702
|
-
|
|
2708
|
+
if (trash && trash.id !== msg.folderId) {
|
|
2709
|
+
this.db.moveMessageLocal(accountId, msg.uid, msg.folderId, trash.id);
|
|
2710
|
+
}
|
|
2711
|
+
else {
|
|
2712
|
+
this.unlinkBodyFile(accountId, msg.uid, msg.folderId).catch(() => { });
|
|
2713
|
+
this.db.deleteMessage(accountId, msg.uid, "user-initiated trash (already in trash → expunge)", "mailx-imap trashMessages");
|
|
2714
|
+
}
|
|
2703
2715
|
}
|
|
2704
|
-
console.log(`
|
|
2716
|
+
console.log(` Trashed ${messages.length} messages locally (moved to trash folder, body files retained)`);
|
|
2705
2717
|
// Queue IMAP actions
|
|
2706
2718
|
for (const msg of messages) {
|
|
2707
2719
|
if (trash && trash.id !== msg.folderId) {
|
|
@@ -2750,9 +2762,17 @@ export class ImapManager extends EventEmitter {
|
|
|
2750
2762
|
/** Move a message to Trash (delete) — local-first, queues IMAP sync */
|
|
2751
2763
|
async trashMessage(accountId, folderId, uid) {
|
|
2752
2764
|
const trash = this.findFolder(accountId, "trash");
|
|
2753
|
-
// Local first —
|
|
2754
|
-
|
|
2755
|
-
|
|
2765
|
+
// Local first — move to trash folder so the row stays visible in
|
|
2766
|
+
// Trash and Ctrl+Z can restore. Body file retained for undelete.
|
|
2767
|
+
// If we're already in trash (or no trash configured), fall through
|
|
2768
|
+
// to hard delete + EXPUNGE.
|
|
2769
|
+
if (trash && trash.id !== folderId) {
|
|
2770
|
+
this.db.moveMessageLocal(accountId, uid, folderId, trash.id);
|
|
2771
|
+
}
|
|
2772
|
+
else {
|
|
2773
|
+
this.unlinkBodyFile(accountId, uid, folderId).catch(() => { });
|
|
2774
|
+
this.db.deleteMessage(accountId, uid, "user-initiated trash (already in trash → expunge)", "mailx-imap trashMessage");
|
|
2775
|
+
}
|
|
2756
2776
|
// Queue IMAP action + log the resolution so "I deleted a message and
|
|
2757
2777
|
// now it's in neither trash nor deleted" is diagnosable from the log.
|
|
2758
2778
|
if (trash && trash.id !== folderId) {
|
|
@@ -2764,6 +2784,12 @@ export class ImapManager extends EventEmitter {
|
|
|
2764
2784
|
this.db.queueSyncAction(accountId, "delete", uid, folderId);
|
|
2765
2785
|
console.log(` [trash] ${accountId} UID ${uid}: queued EXPUNGE in folder ${folderId} (already in trash or no trash configured)`);
|
|
2766
2786
|
}
|
|
2787
|
+
// Folder counts moved — refresh both source and trash so the
|
|
2788
|
+
// tree badges update immediately, not at the next sync.
|
|
2789
|
+
this.db.recalcFolderCounts(folderId);
|
|
2790
|
+
if (trash && trash.id !== folderId)
|
|
2791
|
+
this.db.recalcFolderCounts(trash.id);
|
|
2792
|
+
this.emit("folderCountsChanged", accountId, {});
|
|
2767
2793
|
// Debounced sync — batches multiple deletes into one IMAP session
|
|
2768
2794
|
this.debounceSyncActions(accountId);
|
|
2769
2795
|
}
|
|
@@ -2799,12 +2825,40 @@ export class ImapManager extends EventEmitter {
|
|
|
2799
2825
|
});
|
|
2800
2826
|
});
|
|
2801
2827
|
}
|
|
2802
|
-
/** Undelete — move from Trash back to original folder
|
|
2828
|
+
/** Undelete — move from Trash back to original folder. Local-first:
|
|
2829
|
+
* the row was moved (not deleted) on trash, so we just move it back
|
|
2830
|
+
* in the local DB and reconcile the IMAP queue. Two cases:
|
|
2831
|
+
* (a) the to-trash MOVE is still pending — cancel it; the server
|
|
2832
|
+
* never saw the delete, so no counter-action is needed.
|
|
2833
|
+
* (b) the to-trash MOVE drained — the message is now in Trash on
|
|
2834
|
+
* the server with a new uid. Queue a counter-move from
|
|
2835
|
+
* trash → original. The IMAP processor's fetchByUid in trash
|
|
2836
|
+
* will use the local membership uid (which the reconciler
|
|
2837
|
+
* rebound to the server's new trash uid via Message-ID match).
|
|
2838
|
+
* If reconcile hasn't run yet (unlikely race), action retries
|
|
2839
|
+
* until it does. */
|
|
2803
2840
|
async undeleteMessage(accountId, uid, originalFolderId) {
|
|
2804
2841
|
const trash = this.findFolder(accountId, "trash");
|
|
2805
2842
|
if (!trash)
|
|
2806
2843
|
throw new Error("No Trash folder found");
|
|
2807
|
-
|
|
2844
|
+
// Move locally back to the original folder.
|
|
2845
|
+
const moved = this.db.moveMessageLocal(accountId, uid, trash.id, originalFolderId);
|
|
2846
|
+
if (!moved) {
|
|
2847
|
+
console.log(` [undelete] ${accountId} UID ${uid}: no row in trash — nothing to restore locally (sync may have already pruned)`);
|
|
2848
|
+
}
|
|
2849
|
+
// (a) cancel still-pending to-trash action.
|
|
2850
|
+
const pending = this.db.findPendingSyncAction(accountId, "move", uid, originalFolderId, trash.id);
|
|
2851
|
+
if (pending) {
|
|
2852
|
+
this.db.completeSyncAction(pending.id);
|
|
2853
|
+
console.log(` [undelete] ${accountId} UID ${uid}: cancelled pending MOVE to trash (server never saw delete)`);
|
|
2854
|
+
this.emit("folderCountsChanged", accountId, {});
|
|
2855
|
+
return;
|
|
2856
|
+
}
|
|
2857
|
+
// (b) queue counter-move from trash → original.
|
|
2858
|
+
this.db.queueSyncAction(accountId, "move", uid, trash.id, { targetFolderId: originalFolderId });
|
|
2859
|
+
console.log(` [undelete] ${accountId} UID ${uid}: queued counter-MOVE trash → folder ${originalFolderId}`);
|
|
2860
|
+
this.debounceSyncActions(accountId);
|
|
2861
|
+
this.emit("folderCountsChanged", accountId, {});
|
|
2808
2862
|
}
|
|
2809
2863
|
/** Update flags — local-first, queues IMAP sync */
|
|
2810
2864
|
async updateFlagsLocal(accountId, uid, folderId, flags) {
|