Commit Graph
4546 Commits
Author SHA1 Message Date
Linus Rath 580a7a645d test: check that signing out clears what the desktop app shows outside its windows 2026-11-03 12:50:21 +01:00
Linus Rath 7c8ae2fe89 fix: keep a hidden composer from taking files dropped on the window 2026-11-03 12:29:11 +01:00
Linus Rath 41fcbba61c fix: keep sender and subject off the OS until they're known to be allowed, leave nothing on it after sign-out, and take files only where they're meant 2026-11-03 12:24:14 +01:00
Linus Rath f14116f128 chore: merge the desktop-offline branch into the OS integration branch 2026-11-03 12:10:08 +01:00
Linus Rath cfd5e9988e test: give the calendar import test's client the server address it now asks for 2026-11-03 11:50:26 +01:00
Linus Rath 8512e68d12 feat: merge offline drafts and kept attachments 2026-11-03 11:46:03 +01:00
Linus Rath 2c08b10fef feat: merge the plugin keystore capability 2026-11-03 11:41:30 +01:00
Linus Rath 3dc9e11b4d test: give the store and OS integration test time for its first import 2026-11-03 11:32:51 +01:00
Linus Rath 1d4587f7ea fix: stop a stuck certificate call holding mail rendering, and let a server's certificate access be taken back 2026-11-03 11:31:14 +01:00
Linus Rath df58110989 test: wait out the server's rate limit when polling for drafts in the offline spec 2026-11-03 11:19:30 +01:00
Linus Rath e98741d604 fix: say a store was reset also when a new owner took over the open, and slow raw downloads to one a second 2026-11-03 11:17:53 +01:00
Linus Rath 42263e856d fix: still notify about mail the local store hadn't got when the push arrived 2026-11-03 10:54:17 +01:00
Linus Rath 60eef9c1ef chore: merge the reviewed mail branch, pop-outs and desktop core into the offline drafts branch
The flush keeps one `outbox.dropOrphans` caller, the mail branch's daily
one with its 7 days, and drafts' own query says what's needed, so
`addHeldFileSource` and its test are gone. `unsentCount` counts local
drafts, and a draft a waiting send names counts once. The scope check in
`recordBlob` and the permanent-status rule moved to
`lib/store/mail/attachments.ts`, with tests.
2026-11-03 10:40:52 +01:00
Linus Rath 8e46957188 feat: notify from the local store's new mail and take it offline when the machine sleeps 2026-11-03 10:34:29 +01:00
Linus Rath d1acddb3fd Merge branch 'feat/desktop-offline' into feat/do-os-integration 2026-11-03 10:31:22 +01:00
Linus Rath b805571dec fix: drag attachments and messages out of the desktop app with their bytes in hand 2026-11-03 10:30:37 +01:00
Linus Rath 5a113f95ff test: keep a file through a flush in an open composer, and find a draft whose answer got lost, on both servers 2026-11-03 10:27:52 +01:00
Linus Rath eb365938a2 test: line the merged branches' tests up with the store's wipe rules
The token route now answers 503 when the provider can't be reached, in every build, and a refused renewal for a background account now removes it as evicted, which keeps its data unless the server said invalid_grant. Two assertions from the desktop and pop-out branches change for that. Also drops a duplicate import from the same merge.
2026-11-03 10:26:00 +01:00
Linus Rath 6e262bf1c5 feat: move offline mode onto the encrypted store, with a merged outbox and conflicts
# Conflicts:
#	app/api/auth/token/route.ts
#	lib/offline/offline-mode.ts
#	stores/account-store.ts
#	stores/auth-store.ts
2026-11-03 10:21:34 +01:00
Linus Rath 947743cc9e feat: connect the desktop app's tray, badge, notifications, files and settings to the webmail 2026-11-03 10:13:06 +01:00
Linus Rath 19f6bb8a07 test: find the store reset notice once, not also in the screen reader region 2026-11-03 10:11:31 +01:00
Linus Rath 4fd82437ad fix: keep attachments alive through a flush and never destroy a copy that isn't ours
Review of the offline drafts found these.

- Every new message gets new part ids and old ones die with it, so an
  open composer failed with `blobNotFound` after a flush. The client and
  the flush re-read the draft and re-point parts once. The fake now
  gives new part ids, which is why `drafts.test.ts` and
  `drafts-client.test.ts` compare file contents instead of blob ids.
- A Message-ID alone could destroy another client's message. A copy now
  has to be solely in Drafts, with `$draft`, close to the attempt, with
  the same subject and size, and what the lookup saw is the destroy's
  base. Ghosts ride on the replacing row and only queue once it's up.
  `drafts.created` no longer queues a copy that arrived for a replaced
  row, so its test now expects the next flush to do it.
- Turning offline off asks about device-only drafts too.
- A kept file can't read back empty: chunks of a kept file are left
  alone, and `keptBlob` and `heldFile` refuse pieces that don't add up.
- A flush stopped by a passing failure tries again, the banner shows
  waiting drafts, and under the flush lock a `sending` row counts as
  left by a dead tab at once. A lookup refused for good no longer stops
  the outbox.
- `FetchTransport` streams downloads and reports a broken transfer as
  interrupted, so one bad file doesn't end the pass.
- Raw messages come after every file, only into free room, and a file
  needing room pushes them out first.
- An old version in another login stays until the new one is up. An
  online send of an unflushed stand-in still removes its submission.
2026-11-03 10:06:17 +01:00
Linus Rath 2db3c4b217 feat: let privileged plugins sign and decrypt with the OS certificate store in the desktop app 2026-11-03 09:58:48 +01:00
Linus Rath 7dc4c775cd fix: don't wipe a store just because this window can't open it, and don't send a stand-in when a file's upload is held again 2026-11-03 09:45:03 +01:00
Linus Rath f5c97c1997 test: write a draft offline with a file, and read a kept file offline, on both servers 2026-11-03 09:25:28 +01:00
Linus Rath 9dd6e61d35 test: read the store's raw files without an owner, lose a key for real, and lose only the submission of a send 2026-11-03 09:25:08 +01:00
Linus Rath ebec09212e fix: say plainly when a private window, old stranded mail or a silent server is the problem, and clean the domain of a legacy Message-ID 2026-11-03 09:25:07 +01:00
Linus Rath 024078c597 fix: clear files held for nothing a week after a flush, leaving what other parts of the store still hold 2026-11-03 09:25:06 +01:00
Linus Rath 3dc2fc2c3c fix: give up on a kept attachment only when the server says it won't come 2026-11-03 09:25:05 +01:00
Linus Rath 340ad27e32 fix: send waiting mail when a client connects after the first flush, and come back to stale sends and servers that were down 2026-11-03 09:18:42 +01:00
Linus Rath 9b3bbc6070 fix: delete a store file whose key is gone, say that it happened, and stop waiting on an owner tab that doesn't answer 2026-11-03 09:18:41 +01:00
Linus Rath 5dc0f05a70 fix: count a draft with a waiting send once when signing out 2026-11-03 09:16:32 +01:00
Linus Rath 18efb9f4c3 fix: wait 30 seconds before looking up a send, bound the waits at a start, and keep opened files only as the chosen scope allows 2026-11-03 09:00:52 +01:00
Linus Rath 62a47434e3 fix: ask before a sign-out about everything unsent, including changes, and say when the local store won't open 2026-11-03 08:56:30 +01:00
Linus Rath 3b1fa089aa test: give the stand-in desktop bridge its version and platform 2026-11-03 08:54:05 +01:00
Linus Rath cdda75d13b fix: keep queued changes and mail through rate limits, logins that need renewing and proxy errors, and show the server's copy after a real refusal 2026-11-03 08:49:53 +01:00
Linus Rath 5c5d982f9d feat: save drafts and keep attachments while offline
A draft saved offline now stays on the device under a stand-in id and
goes to the server by itself when it's back. Until now every save was
refused and the composer showed "not saved".

- `lib/store/drafts`: one pending create per draft, however often it's
  saved. A draft from the server edited offline is replaced by create,
  then destroy, so a failure leaves a copy. Each create has a fixed
  Message-ID, looked up in Drafts after a lost response. A refused
  draft stays on the device with its error and can be opened. Changed
  on another device: both are kept and the user is told.
- `JMAPClient`: stand-in ids in Email/get and Email/set resolve like
  calendar's, also when answering from the device. A file attached
  offline stays readable, and is uploaded before a save that names it.
- Held files and kept mail files are stored in 1 MB chunks. Orphans are
  dropped at the end of a flush, counting what drafts need.
- `lib/store/mail/attachments.ts`: attachments, inline images and raw
  messages per scope, newest first, after everything else in a pass,
  with eviction that spares pinned mail and never sees held files.
- `mail.rawBlob` and `mail.rawStatus` for an offline export.

Changed test assertions: `outbox.heldFile` and `mail.getBlob` return
`blob` instead of `data`, so a file isn't held whole in memory. The
attachment tests ignore raw downloads, and mail-sync runs with
attachments off, because raw messages add a commit per message.
2026-11-03 08:49:19 +01:00
Linus Rath 2b48047bcc feat: merge the webmail side of the desktop app
# Conflicts:
#	lib/desktop/types.ts
#	locales/ar/common.json
#	locales/ca/common.json
#	locales/cs/common.json
#	locales/da/common.json
#	locales/de/common.json
#	locales/en/common.json
#	locales/es/common.json
#	locales/et/common.json
#	locales/fa/common.json
#	locales/fr/common.json
#	locales/he/common.json
#	locales/hu/common.json
#	locales/it/common.json
#	locales/ja/common.json
#	locales/ko/common.json
#	locales/lv/common.json
#	locales/mn/common.json
#	locales/nb/common.json
#	locales/nl/common.json
#	locales/pl/common.json
#	locales/pt/common.json
#	locales/ro/common.json
#	locales/ru/common.json
#	locales/sk/common.json
#	locales/th/common.json
#	locales/tr/common.json
#	locales/uk/common.json
#	locales/vi/common.json
#	locales/zh-TW/common.json
#	locales/zh/common.json
#	stores/account-store.ts
2026-11-03 08:48:10 +01:00
Linus Rath 074d42e62a fix: stop keeping a plain mail list for accounts in the store and drop a stale answer from a replaced client 2026-11-03 08:43:36 +01:00
Linus Rath 55ca12adbd fix: say when a start stays on the local copy, queue its sends, paint it only with folders kept and fill the From list after the swap 2026-11-03 08:43:35 +01:00
Linus Rath 512422addd feat: merge title bar, pop-out windows and saving attachments to a folder 2026-11-03 08:37:29 +01:00
Linus Rath b79781cc94 fix: never lose a draft moving between windows and keep credentials off the window channel
Review of the pop-out work found ways to lose text, a wrong sign-out and
changes reaching ordinary browser tabs.

- Drafts: a closing window hands text over only to a main window holding
  its login, and asks instead when the last save failed, the browser is
  offline, a save is running or plugins could still have a say. A failed
  rescue goes to "Continue draft". The opening window lets go only once
  the composer is on screen, also for Edit draft in a message window.
  Send options travel with the draft. Closing during a send asks first.
- Sessions: answers are encrypted for the window that asked, and only a
  window holding the login answers. A renewal queued on the lock can be
  called off by a sign-out, signs nobody out once its account is gone, and
  takes the cached token after waiting (Rauthy `nbf`, #552).
- Ordinary tabs run none of the host. No lock is held for life.
- A message window hides after a refused session and waits for its
  folders; a composer stays on screen with its text. Another tab dropping a
  login it couldn't restore no longer closes pop-outs.
- Plain-text mail stays selectable in the desktop app. Folder save renames
  reserved and shell names and skips one refused name. All display-mode
  checks know the overlay. The attachment bar keeps to one row.

The earlier test that accepted text being gone after a failed rescue now
asserts that it reaches the "Continue draft" slot.
2026-11-03 08:37:10 +01:00
Linus Rath 706550daf4 fix: keep local mail and the outbox when an automatic sign-out wasn't a real refusal of the login, for 30 days at most 2026-11-03 08:33:03 +01:00
Linus Rath 10a2c99b83 fix: keep syncing when a message has two keywords differing only in case, and compare keywords the way the server does 2026-11-03 08:22:15 +01:00
Linus Rath 46766ac8aa fix: let a server build pass its guard, and let the desktop app save drafts and forget a server on sign-out 2026-11-03 07:57:35 +01:00
Linus Rath f2d1b54c3e test: catch the forbidden notice whenever the policy arrives in the offline spec 2026-11-03 07:43:51 +01:00
Linus Rath a365ba9041 Merge branch 'feat/desktop-offline' into feat/do-desktop-core 2026-11-03 07:34:32 +01:00
Linus Rath 2ebb5ea9cf test: run the handoff wipes on the local store 2026-11-03 07:31:50 +01:00
Linus Rath dccf4e8b9f chore: merge feat/desktop-offline into the windows branch 2026-11-03 07:31:32 +01:00
Linus Rath b1c4bb00d9 chore: merge opening files and sharing into the mail branch 2026-11-03 07:30:08 +01:00