File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -486,8 +486,9 @@ class NotificationDisplayManager {
486
486
assert (url.scheme == 'zulip' && url.host == 'notification' );
487
487
final payload = NotificationOpenPayload .parseUrl (url);
488
488
489
- final account = globalStore.accounts.firstWhereOrNull ((account) =>
490
- account.realmUrl == payload.realmUrl && account.userId == payload.userId);
489
+ final account = globalStore.accounts.firstWhereOrNull (
490
+ (account) => account.realmUrl.origin == payload.realmUrl.origin
491
+ && account.userId == payload.userId);
491
492
if (account == null ) { // TODO(log)
492
493
showNotificationErrorDialog ();
493
494
return null ;
Original file line number Diff line number Diff line change @@ -1037,6 +1037,21 @@ void main() {
1037
1037
eg.dmMessage (from: eg.otherUser, to: [eg.selfUser]));
1038
1038
});
1039
1039
1040
+ testWidgets ('account queried by realmUrl origin component' , (tester) async {
1041
+ addTearDown (testBinding.reset);
1042
+ await testBinding.globalStore.add (
1043
+ eg.selfAccount.copyWith (realmUrl: Uri .parse ('http://chat.example' )),
1044
+ eg.initialSnapshot ());
1045
+ await prepare (tester);
1046
+
1047
+ await checkOpenNotification (tester,
1048
+ eg.selfAccount.copyWith (realmUrl: Uri .parse ('http://chat.example/' )),
1049
+ eg.streamMessage ());
1050
+ await checkOpenNotification (tester,
1051
+ eg.selfAccount.copyWith (realmUrl: Uri .parse ('http://chat.example' )),
1052
+ eg.streamMessage ());
1053
+ });
1054
+
1040
1055
testWidgets ('no accounts' , (tester) async {
1041
1056
await prepare (tester, withAccount: false );
1042
1057
await openNotification (tester, eg.selfAccount, eg.streamMessage ());
You can’t perform that action at this time.
0 commit comments