From ba3a9a2d9c4f8f7358241b723590d1d66ae2cabd Mon Sep 17 00:00:00 2001 From: FaizHashmiCS22 Date: Mon, 7 Jul 2025 10:52:35 +0300 Subject: [PATCH] Debugged HTTPTransportType --- lib/home/app_provider.dart | 1 - lib/utils/signalR_utils.dart | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/home/app_provider.dart b/lib/home/app_provider.dart index eeb3de8..16bd180 100644 --- a/lib/home/app_provider.dart +++ b/lib/home/app_provider.dart @@ -145,7 +145,6 @@ class AppProvider extends ChangeNotifier { WidgetsConfigModel? currentWidgetsConfigModel; Future getInfoWidgetsConfigurationsFromServer() async { - log(" errorHellpo:"); WidgetsConfigModel? widgetsConfigModel = await API.getWidgetConfigsFromServer(currentDeviceIp, onFailure: (error) { logger.i("Api call failed with this error: ${error.toString()}"); }); diff --git a/lib/utils/signalR_utils.dart b/lib/utils/signalR_utils.dart index be1436f..53e4318 100644 --- a/lib/utils/signalR_utils.dart +++ b/lib/utils/signalR_utils.dart @@ -41,8 +41,6 @@ class SignalRHelper { url, HttpConnectionOptions( client: IOClient(HttpClient()..badCertificateCallback = (x, y, z) => true), - - //TODO: IT MUST BE WEB SOCKETS transport: HttpTransportType.webSockets, logging: (level, message) => log(message), )) @@ -57,7 +55,11 @@ class SignalRHelper { connection!.on('addChatMessage', (message) => onUpdateAvailable(message)); - await connection!.start(); + try { + await connection!.start(); + } catch (e) { + logger.i("Exception while connecting: ${e.toString()}"); + } } void sendMessage(List args) async { @@ -78,7 +80,6 @@ class SignalRHelper { } } - // startConnection(BuildContext context) async { // if (connection!.state == HubConnectionState.connected || connection!.state == HubConnectionState.connecting) { // connection!.off('addChatMessage');