feat: drop Sieve fields from add-account; auto-probe ManageSieve
The IMAP/SMTP add-account form no longer asks for a ManageSieve host, port, or SSL toggle. After the account is saved, a background probe opens TCP+STARTTLS to the IMAP host on port 4190 and stores a tri-state result (manageSieveAvailable: null / true / false). The "Email filters" menu item is hidden when the probe records false, so servers that don't expose ManageSieve don't surface a dead menu. Edge-case overrides (different sieve host, non-standard port, plain TCP) remain available in Edit Account, and changing them clears the cached probe result so the next save re-probes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
da383d0957
commit
dad239e0b6
@@ -19,6 +19,7 @@ import 'package:sharedinbox/core/repositories/email_repository.dart';
|
||||
import 'package:sharedinbox/core/repositories/mailbox_repository.dart';
|
||||
import 'package:sharedinbox/core/services/account_discovery_service.dart';
|
||||
import 'package:sharedinbox/core/services/connection_test_service.dart';
|
||||
import 'package:sharedinbox/core/services/managesieve_probe_service.dart';
|
||||
import 'package:sharedinbox/di.dart';
|
||||
import 'package:sharedinbox/ui/screens/account_list_screen.dart';
|
||||
import 'package:sharedinbox/ui/screens/add_account_screen.dart';
|
||||
@@ -273,6 +274,11 @@ class FakeConnectionTestService implements ConnectionTestService {
|
||||
}
|
||||
}
|
||||
|
||||
class _NoOpManageSieveProbeService implements ManageSieveProbeService {
|
||||
@override
|
||||
Future<void> probe(Account account) async {/* no-op in tests */}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// App builder
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -358,7 +364,14 @@ Widget buildApp({
|
||||
);
|
||||
|
||||
return ProviderScope(
|
||||
overrides: overrides,
|
||||
// Always neutralise the ManageSieve probe so widget tests never open a
|
||||
// real socket. Tests that need to assert on probe behaviour should supply
|
||||
// their own override before this default in [overrides].
|
||||
overrides: [
|
||||
...overrides,
|
||||
manageSieveProbeServiceProvider
|
||||
.overrideWith((ref) => _NoOpManageSieveProbeService()),
|
||||
],
|
||||
child: MaterialApp.router(
|
||||
routerConfig: testRouter,
|
||||
theme: ThemeData(
|
||||
|
||||
Reference in New Issue
Block a user