diff --git a/lib/services/sync/sync_outbox.dart b/lib/services/sync/sync_outbox.dart index e02d077..9a708ef 100644 --- a/lib/services/sync/sync_outbox.dart +++ b/lib/services/sync/sync_outbox.dart @@ -41,7 +41,9 @@ class SyncOutbox { final operation = _saveChain.then((_) async { if (_items.length > maxOutboxCapacity) { final terminal = _items.values.where((i) => i.status.isTerminal).toList()..sort((a, b) => a.createdAt.compareTo(b.createdAt)); - while (_items.length > maxOutboxCapacity && terminal.isNotEmpty) _items.remove(terminal.removeAt(0).key); + while (_items.length > maxOutboxCapacity && terminal.isNotEmpty) { + _items.remove(terminal.removeAt(0).key); + } } if (_items.length > maxOutboxCapacity) throw StateError('Sync outbox capacity reached with no evictable terminal items.'); return _prefs.setString(_outboxStorageKey, jsonEncode(_items.values.map((e) => e.toJson()).toList()));