feat(streaming): Simplify streaming logic and remove persistent tracking
This commit is contained in:
@@ -13,7 +13,6 @@ import '../services/app_intents_service.dart';
|
||||
import '../services/quick_actions_service.dart';
|
||||
import '../models/conversation.dart';
|
||||
import '../services/background_streaming_handler.dart';
|
||||
import '../services/persistent_streaming_service.dart';
|
||||
import '../services/socket_service.dart';
|
||||
import '../../features/onboarding/views/onboarding_sheet.dart';
|
||||
import '../../features/chat/providers/chat_providers.dart';
|
||||
@@ -198,15 +197,6 @@ class AppStartupFlow extends _$AppStartupFlow {
|
||||
keepAlive(socketPersistenceProvider);
|
||||
});
|
||||
|
||||
// Ensure persistent streaming uses the shared connectivity service
|
||||
final connectivityService = ref.read(connectivityServiceProvider);
|
||||
Future<void>.delayed(const Duration(milliseconds: 160), () {
|
||||
if (!ref.mounted) return;
|
||||
PersistentStreamingService().attachConnectivityService(
|
||||
connectivityService,
|
||||
);
|
||||
});
|
||||
|
||||
// Warm the conversations list in the background as soon as possible,
|
||||
// but avoid doing so on poor connectivity to reduce startup load.
|
||||
// Apply a small randomized delay to smooth load spikes across app wakes.
|
||||
@@ -432,7 +422,7 @@ class _ForegroundRefreshObserver extends WidgetsBindingObserver {
|
||||
}
|
||||
|
||||
/// Attempts to keep the realtime socket connection alive while the app is
|
||||
/// backgrounded, similar to how PersistentStreamingService works for streams.
|
||||
/// backgrounded using BackgroundStreamingHandler for platform-specific handling.
|
||||
///
|
||||
/// Notes:
|
||||
/// - iOS: limited to short background task windows; we send periodic keepAlive.
|
||||
|
||||
Reference in New Issue
Block a user