Throttle message notifications during sync

This commit is contained in:
Janez T
2026-05-10 17:48:13 +02:00
parent e1400cf1ec
commit 6062f91c2d
3 changed files with 86 additions and 15 deletions

View File

@@ -2567,8 +2567,11 @@ class AppProvider with ChangeNotifier {
debugPrint(
'🔄 [AppProvider] Performing initial message sync (fallback for missed pushes)',
);
final initialMessageCount = await connectionProvider.syncAllMessages(
force: true,
final initialMessageCount =
await messagesProvider.withReceivedNotificationsSuppressed(
() => connectionProvider.syncAllMessages(
force: true,
),
);
debugPrint(
'📥 [AppProvider] Initial sync retrieved $initialMessageCount message(s)',
@@ -2627,8 +2630,11 @@ class AppProvider with ChangeNotifier {
);
await refreshChannelLocationSharingState();
final messageCount = await connectionProvider.syncAllMessages(
force: true,
final messageCount =
await messagesProvider.withReceivedNotificationsSuppressed(
() => connectionProvider.syncAllMessages(
force: true,
),
);
debugPrint(
'📥 [AppProvider] Reconnect sync retrieved $messageCount message(s)',