Commit Graph

6 Commits

Author SHA1 Message Date
felixfoertsch df78397870 fix stale IMAP connection: clean up old connection on reconnect, robust disconnect
- connect() now cleans up any stale connection/event loop group before
  creating a new one, preventing leaked resources after failed syncs
- disconnect() uses try? for both channel close and group shutdown so
  "Already closed" errors don't prevent cleanup

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 12:10:53 +01:00
felixfoertsch 10b7cb2fd2 fix code review issues: deferral date format, storeFlags SELECT, event loop leaks, GTD selection tracking
- fix deferral resurfacing using VTODOParser.formatDateOnly instead of ISO8601 (date format mismatch)
- add SELECT mailbox before UID STORE in storeFlags (IMAP protocol requirement)
- pass credentials to SyncCoordinator so IDLE monitoring activates
- add selectedItem tracking to MailViewModel, wire List selection in GTD views
- fix startPeriodicSync to sleep-first, preventing duplicate sync on launch
- add deinit cleanup for EventLoopGroup in IMAPConnection, SMTPConnection
- use separate IMAP client for attachment downloads, avoid shared connection interference
- remove [weak self] from IMAPIdleClient actor Task to prevent orphaned connections
- fix isGTDPerspective to check selectedMailbox instead of items.isEmpty
- fix fetchBody to use complete RFC822 fetch instead of BODY[TEXT]
- reuse single IMAP connection per ActionQueue.flush() batch
- add requiresIMAP to ActionPayload for connection batching
- load task categories from label store instead of hardcoded empty array
- suppress NIOSSLHandler Sendable warnings via Package.swift unsafeFlags
- fix unused variable warnings across codebase

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 23:13:46 +01:00
felixfoertsch 004d1ad027 remove inline body fetch from fetchEnvelopes, bodies now come from MIME-aware prefetchBodies
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 13:41:33 +01:00
felixfoertsch 968dd91f80 add fetchFullMessage, fetchSection to IMAPClient for MIME attachment retrieval 2026-03-14 13:31:38 +01:00
felixfoertsch 427f197bb3 add IMAP write operations, special folder role detection
Extend IMAPClientProtocol with storeFlags, moveMessage, copyMessage,
expunge, appendMessage, capabilities methods. Implement all six in
IMAPClient actor using NIOIMAPCore typed commands. Add multi-part
command support to IMAPConnection/IMAPCommandRunner for APPEND.
MockIMAPClient tracks all write calls for testing. SyncCoordinator
detects mailbox roles from LIST attributes with name-based fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 05:13:39 +01:00
felixfoertsch 21227b3c78 add real IMAPClient actor with NIO connection, command pipeline, envelope parsing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 21:12:39 +01:00