Anthony 922738fd1e Wire inline decrypt into the event handler — Mail UPDATEs go REST-free
Two new MailBackend methods, `decrypt_inline_mail` and
`decrypt_inline_mail_set_entry`, delegate to the SDK's
`CryptoEntityClient::decrypt_inline_and_parse<T>`. The event handler now
takes the inline path first, and only falls back to `load_mail` if the
payload was missing or its session key was unresolvable:

- Mail UPDATE: a new `resolve_mail` helper centralises the
  decrypt-then-fallback policy. Most UPDATE events (read/unread, label
  moves, …) now do zero REST calls, since the encrypted Mail rides
  inside `event.instance`.
- MailSetEntry CREATE miss path: decode `event.instance` of the
  MailSetEntry inline, read its `mail: IdTupleGenerated` field, then
  `load_mail` it with the correct list_id. Drops the previous
  `mail_list_id_cache` sniffing hack on MailStore (and its test) —
  the inline payload always carries the correct list_id, no need to
  guess from any cached Mail.

`resolve_mail_set_entry` factors the same try-inline-first pattern for
MailSetEntry events. Both helpers fall back to a `sync_folder` if every
path fails, preserving the no-silent-miss guarantee from Phase 2.

`MockBackend` returns `Ok(None)` from both new methods by default so
existing handler tests keep their REST behaviour; the live SDK fixture
test (`tests/decrypt_inline_test.rs` on the SDK side) covers the real
decryption.

165 bridge lib tests pass.
2026-05-28 15:05:54 +02:00
Languages
Rust 89.5%
TypeScript 5.9%
CSS 2.5%
Python 1.2%
Shell 0.7%
Other 0.1%