From 8cb932eb84b4df3660bc4fe6d78da726defac9a7 Mon Sep 17 00:00:00 2001 From: abdellah-darni Date: Thu, 28 May 2026 19:01:06 +0100 Subject: [PATCH 1/3] logout bug fix --- client/deepdame/lib/features/settings/settings_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/deepdame/lib/features/settings/settings_screen.dart b/client/deepdame/lib/features/settings/settings_screen.dart index e571d46..e588b1a 100644 --- a/client/deepdame/lib/features/settings/settings_screen.dart +++ b/client/deepdame/lib/features/settings/settings_screen.dart @@ -487,7 +487,7 @@ class _LogoutTile extends ConsumerWidget { if (confirmed != true) return; await ref.read(authControllerProvider.notifier).logout(); - // Router redirect handles navigation to the login screen + if (context.mounted) context.goNamed('login'); } } From 5095139e675cb9806c56547036f9ac2ef77eef7b Mon Sep 17 00:00:00 2001 From: abdellah-darni Date: Thu, 28 May 2026 19:28:59 +0100 Subject: [PATCH 2/3] Update StompService to support automatic subscription re-registration - Modify `subscribe` to maintain a persistent state listener that re-triggers subscriptions upon reconnection. - Ensure previous subscriptions are cleared before re-subscribing. - Improve cleanup by cancelling the state subscription when the stream is closed. --- .../lib/core/network/stomp_service.dart | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/client/deepdame/lib/core/network/stomp_service.dart b/client/deepdame/lib/core/network/stomp_service.dart index 16681aa..1bb6330 100644 --- a/client/deepdame/lib/core/network/stomp_service.dart +++ b/client/deepdame/lib/core/network/stomp_service.dart @@ -70,8 +70,10 @@ class StompService { Stream> subscribe(String destination) { final controller = StreamController>.broadcast(); void Function()? unsubscribe; + StreamSubscription? stateSub; void doSubscribe() { + unsubscribe?.call(); unsubscribe = _client?.subscribe( destination: destination, callback: (frame) { @@ -85,19 +87,19 @@ class StompService { ); } - if (isConnected) { - doSubscribe(); - } else { - late StreamSubscription sub; - sub = state.listen((s) { - if (s == StompState.connected) { - doSubscribe(); - unawaited(sub.cancel()); - } - }); - } + // Keep the listener alive for the full stream lifetime so every + // reconnect re-registers the subscription with the new STOMP session. + stateSub = state.listen((s) { + if (s == StompState.connected) doSubscribe(); + }); + + if (isConnected) doSubscribe(); + + controller.onCancel = () { + unsubscribe?.call(); + unawaited(stateSub?.cancel()); + }; - controller.onCancel = () => unsubscribe?.call(); return controller.stream; } From c2a8a50b1b56c7ed8966dae3c39fa4ddbd11f0d3 Mon Sep 17 00:00:00 2001 From: abdellah-darni Date: Thu, 28 May 2026 19:35:34 +0100 Subject: [PATCH 3/3] Bump version to 2.0.25+26 --- client/deepdame/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/deepdame/pubspec.yaml b/client/deepdame/pubspec.yaml index 78a2e04..a61e628 100644 --- a/client/deepdame/pubspec.yaml +++ b/client/deepdame/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 2.0.24+25 +version: 2.0.25+26 environment: sdk: ^3.10.4