feat: username field separate from email, try-connection button, JMAP auth verification

- Account model gains `username` field (default empty → falls back to email then local-part)
- ConnectionTestService returns the effective username that succeeded; tries email then local-part when blank
- JMAP connection probe uses Basic-auth GET to /.well-known/jmap (401/403 = auth failure)
- IMAP/SMTP factory passes explicit username parameter
- Add/edit account screens show username field and "Try connection" button
- EditAccountScreen reuses stored password when no new password is entered
- Unit tests for ConnectionTestServiceImpl (IMAP + JMAP paths, fallback logic)
- Fix unit test lambda signatures for updated ImapConnectFn/SmtpConnectFn

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas Güttler
2026-04-18 15:37:11 +02:00
co-authored by Claude Sonnet 4.6
parent 442c3c4087
commit b144dba5ec
14 changed files with 524 additions and 85 deletions
+2 -1
View File
@@ -149,8 +149,9 @@ class FakeConnectionTestService implements ConnectionTestService {
final Exception? _error;
@override
Future<void> testConnection(Account account, String password) async {
Future<String> testConnection(Account account, String password) async {
if (_error != null) throw _error;
return account.username.isNotEmpty ? account.username : account.email;
}
}