Add Repeaters and Rooms settings for login and clock sync

Move login attempts and auto-fetch into the new section, and let a global clock-sync default be overridden per repeater.

Co-authored-by: zjs81 <zjs81@users.noreply.github.com>
This commit is contained in:
Cursor Agentandzjs81 committed 2026-11-21 01:06:26 +00:00
1 parent 1b804bd1eb
commit dca270e5ad
53 files changed
+1533 -128

No files matched your search

+26 -1
View File
@@ -133,7 +133,7 @@ void main() {
expect(settings.autoRouteRotationEnabled, isTrue);
expect(settings.directRetries, SendAttemptPlan.defaultDirectRetries);
expect(settings.floodRetries, SendAttemptPlan.defaultFloodRetries);
expect(settings.loginAttempts, SendAttemptPlan.defaultLoginAttempts);
expect(settings.loginAttempts, 9);
expect(settings.channelMinHopsEnabled, isFalse);
expect(settings.channelMinHops, 2);
expect(settings.channelMinHopsRetries, 1);
@@ -147,5 +147,30 @@ void main() {
SendAttemptPlan.defaultDirectRetries,
);
expect(reloaded.settings.floodRetries, SendAttemptPlan.defaultFloodRetries);
expect(reloaded.settings.loginAttempts, 9);
});
test('reset repeater and room settings restores that section', () async {
SharedPreferences.setMockInitialValues({});
await PrefsManager.initialize();
final service = AppSettingsService();
await service.loadSettings();
await service.updateSettings(
service.settings.copyWith(
clockSyncAfterLogin: true,
loginPasswordAutofocus: true,
autoFetchRepeaterSettings: true,
loginAttempts: 8,
directRetries: 12,
),
);
await service.resetRepeaterRoomSettingsToDefault();
final settings = service.settings;
expect(settings.clockSyncAfterLogin, isFalse);
expect(settings.loginPasswordAutofocus, isFalse);
expect(settings.autoFetchRepeaterSettings, isFalse);
expect(settings.loginAttempts, SendAttemptPlan.defaultLoginAttempts);
expect(settings.directRetries, 12);
});
}