From 25afcf4acd338676f8d92ce77e70fac8f210e23c Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Sat, 3 Oct 2026 11:53:32 -0400 Subject: [PATCH 1/2] fix silent useless error during verify --- lib/controllers/unified_push.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/controllers/unified_push.dart b/lib/controllers/unified_push.dart index 6b1538d..c4d923c 100644 --- a/lib/controllers/unified_push.dart +++ b/lib/controllers/unified_push.dart @@ -63,10 +63,14 @@ class UnifiedPushController extends AsyncNotifier { "Failed to decrypt notification. Try toggling off and on UnifiedPush in settings.", ); } - final (event, roomMetadata) = await ref + final pushResponse = await ref .read(ClientController.provider.notifier) .handlePush(json.decode(String.fromCharCodes(message.content))); + if (pushResponse == null) return; + + final (event, roomMetadata) = pushResponse; + if (event.unreadType?.shouldNotify() != true || (!isInBackground && await windowManager.isFocused().onError((_, _) => true) && From 493776e3ddf50a5c739677a1684069470351ac9b Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Sat, 3 Oct 2026 11:56:17 -0400 Subject: [PATCH 2/2] clear init complete state on logout --- lib/controllers/client.dart | 12 +++++++----- lib/controllers/settings_sections.dart | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/controllers/client.dart b/lib/controllers/client.dart index 07a3025..0ba29d5 100644 --- a/lib/controllers/client.dart +++ b/lib/controllers/client.dart @@ -122,16 +122,18 @@ class ClientController extends AsyncNotifier { } } - Future<(Event, RoomMetadata)> handlePush(Map data) async { + Future<(Event, RoomMetadata)?> handlePush(Map data) async { final response = await callGomuksMethod( data, (handle, data) async => GomuksHandlePush(handle, data), ); - return ( - Event.fromJson(response["event"]), - RoomMetadata.fromJson(response["room"]), - ); + return response == null + ? null + : ( + Event.fromJson(response["event"]), + RoomMetadata.fromJson(response["room"]), + ); } Future _sendCommand( diff --git a/lib/controllers/settings_sections.dart b/lib/controllers/settings_sections.dart index 1dd6db9..cedd81a 100644 --- a/lib/controllers/settings_sections.dart +++ b/lib/controllers/settings_sections.dart @@ -9,6 +9,7 @@ import "package:m3e_buttons/m3e_buttons.dart"; import "package:nexus/controllers/account_data.dart"; import "package:nexus/controllers/client.dart"; import "package:nexus/controllers/client_state.dart"; +import "package:nexus/controllers/init_complete.dart"; import "package:nexus/controllers/notification.dart"; import "package:nexus/controllers/settings.dart"; import "package:nexus/controllers/unified_push.dart"; @@ -277,6 +278,7 @@ class SettingsSectionsController .read(UnifiedPushController.provider.notifier) .deregister() .onError(showError); + container.invalidate(InitCompleteController.provider); await container .read(ClientController.provider.notifier) .logout()