diff --git a/lib/features/push_notification/presentation/websocket/web_socket_queue_handler.dart b/lib/features/push_notification/presentation/websocket/web_socket_queue_handler.dart index 155b0deb6..455473983 100644 --- a/lib/features/push_notification/presentation/websocket/web_socket_queue_handler.dart +++ b/lib/features/push_notification/presentation/websocket/web_socket_queue_handler.dart @@ -116,6 +116,9 @@ class WebSocketQueueHandler { bool isMessageProcessed(String messageId) => _processedMessageIds.contains(messageId); void dispose() { + _messageQueue.clear(); + _processedMessageIds.clear(); _queueController.close(); + _processingLock = null; } } diff --git a/lib/features/search/email/presentation/search_email_controller.dart b/lib/features/search/email/presentation/search_email_controller.dart index 37c9081eb..2bed6ef89 100644 --- a/lib/features/search/email/presentation/search_email_controller.dart +++ b/lib/features/search/email/presentation/search_email_controller.dart @@ -1030,6 +1030,7 @@ class SearchEmailController extends BaseController _deBouncerTime.cancel(); emailUIActionWorker.dispose(); dashBoardActionWorker.dispose(); + _webSocketQueueHandler?.dispose(); super.onClose(); } } \ No newline at end of file diff --git a/lib/features/thread/presentation/thread_controller.dart b/lib/features/thread/presentation/thread_controller.dart index c23994fcd..f3d2fa672 100644 --- a/lib/features/thread/presentation/thread_controller.dart +++ b/lib/features/thread/presentation/thread_controller.dart @@ -149,6 +149,7 @@ class ThreadController extends BaseController with EmailActionController { if (PlatformInfo.isWeb) { _resizeBrowserStreamSubscription?.cancel(); } + _webSocketQueueHandler?.dispose(); super.onClose(); }