audit #13: notification fix, sync guard, bypass gate, responsive layout, dynamic version, dart format, clock_display to backups, stats race fix, new locks, nginx swarm block

This commit is contained in:
esefxdz committed 2026-07-31 22:41:29 +03:00
1 parent e1c5d5b106
commit 54609a3119
11 files changed
+132 -67

No files matched your search

+8 -3
View File
@@ -20,6 +20,7 @@ class SessionTimer extends ChangeNotifier {
int _consecutiveFailures = 0;
bool _isDisconnecting = false;
bool _userInitiatedStop = false;
bool _syncInProgress = false;
int? _currentPort;
@@ -183,9 +184,10 @@ class SessionTimer extends ChangeNotifier {
Future<void> _syncWithHivemind() async {
// Never sync while the user is explicitly disconnecting.
if (_isDisconnecting) return;
// Never sync while the user is explicitly disconnecting,
// or while another sync is already in flight.
if (_isDisconnecting || _syncInProgress) return;
_syncInProgress = true;
try {
final deviceId = await CryptoService.getDeviceId();
final url = Uri.parse(
@@ -248,6 +250,8 @@ class SessionTimer extends ChangeNotifier {
} catch (e) {
debugPrint('Hivemind sync error: $e');
_markSyncFailure();
} finally {
_syncInProgress = false;
}
}
@@ -268,6 +272,7 @@ class SessionTimer extends ChangeNotifier {
_currentSpeedKBps = 0.0;
_hasSyncedOnce = false;
_remainingSeconds = 0;
VpnNotificationManager.cancel();
notifyListeners();
}