@bobfrankston/mailx 1.0.300 → 1.0.302

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.
@@ -1 +1 @@
1
- {"height":1420,"width":2304,"x":528,"y":99}
1
+ {"height":1420,"width":2502,"x":422,"y":79}
package/client/app.js CHANGED
@@ -364,6 +364,22 @@ document.getElementById("btn-restart-quick")?.addEventListener("click", async ()
364
364
  catch { /* server is shutting down */ }
365
365
  }
366
366
  });
367
+ document.getElementById("btn-update")?.addEventListener("click", async () => {
368
+ if (restartDropdown)
369
+ restartDropdown.hidden = true;
370
+ const statusSync = document.getElementById("status-sync");
371
+ if (statusSync)
372
+ statusSync.textContent = "Checking for updates...";
373
+ const ipc = window.mailxapi || window.opener?.mailxapi;
374
+ if (ipc?.performUpdate) {
375
+ if (statusSync)
376
+ statusSync.textContent = "Updating... mailx will restart when done";
377
+ ipc.performUpdate();
378
+ }
379
+ else if (statusSync) {
380
+ statusSync.textContent = "Update not available in this mode";
381
+ }
382
+ });
367
383
  document.getElementById("btn-rebuild")?.addEventListener("click", async () => {
368
384
  if (restartDropdown)
369
385
  restartDropdown.hidden = true;
package/client/index.html CHANGED
@@ -54,6 +54,7 @@
54
54
  </button>
55
55
  <div class="tb-menu-dropdown" id="restart-dropdown" hidden>
56
56
  <button class="tb-menu-item" id="btn-restart-quick" title="Reload the page">Reload</button>
57
+ <button class="tb-menu-item" id="btn-update" title="Check for updates and install if available">Check for updates</button>
57
58
  <button class="tb-menu-item" id="btn-rebuild" title="Wipe local DB and message cache, re-download everything. Accounts and settings are preserved. Safe and fast.">Rebuild local cache</button>
58
59
  <hr class="tb-menu-sep">
59
60
  <span class="tb-menu-hint">CLI: mailx --rebuild for full reset</span>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx",
3
- "version": "1.0.300",
3
+ "version": "1.0.302",
4
4
  "description": "Local-first email client with IMAP sync and standalone native app",
5
5
  "type": "module",
6
6
  "main": "bin/mailx.js",
@@ -659,8 +659,18 @@ export class ImapManager extends EventEmitter {
659
659
  let messages;
660
660
  const firstSync = highestUid === 0;
661
661
  const historyDays = getHistoryDays(accountId);
662
- // For first sync with unlimited history, start with 30 days backfill extends later
663
- const effectiveDays = (historyDays === 0 && firstSync) ? 30 : historyDays;
662
+ // IMAP: historyDays=0 (unlimited) is dangerous"SEARCH SINCE 1970"
663
+ // asks the server to enumerate every message, which Dovecot times out
664
+ // on (300s). Cap at 90 days for IMAP. Gmail API handles 0 fine via
665
+ // pagination. The first-sync cap (30) applies when starting from
666
+ // scratch so the UI isn't empty for minutes.
667
+ const isGmail = this.isGmailAccount(accountId);
668
+ const MAX_IMAP_DAYS = 90;
669
+ let effectiveDays = historyDays;
670
+ if (historyDays === 0 && !isGmail)
671
+ effectiveDays = MAX_IMAP_DAYS;
672
+ if (effectiveDays === 0 && firstSync)
673
+ effectiveDays = 30;
664
674
  const startDate = effectiveDays > 0
665
675
  ? new Date(Date.now() - effectiveDays * 86400000)
666
676
  : new Date(0);