Skip to content

notif: On Android, use org name instead of URL as notif group summary#2136

Merged
gnprice merged 1 commit intozulip:mainfrom
rajveermalviya:pr-android-notif-org-name
Feb 18, 2026
Merged

notif: On Android, use org name instead of URL as notif group summary#2136
gnprice merged 1 commit intozulip:mainfrom
rajveermalviya:pr-android-notif-org-name

Conversation

@rajveermalviya
Copy link
Copy Markdown
Member

Zulip Server 8 (FL 234) started sending realmName in the FCM payload:
zulip/zulip@a018f2611

So, we try to use the realm name from the account first, then fallback to notification data, and then finally fallback to displaying the realm URL.

Fixes: #570

@rajveermalviya
Copy link
Copy Markdown
Member Author

Screenshots:

Before After
Screenshot 2026-02-12 at 21 51 17 Screenshot 2026-02-12 at 21 48 10

@rajveermalviya rajveermalviya added the maintainer review PR ready for review by Zulip maintainers label Feb 12, 2026
@rajveermalviya rajveermalviya force-pushed the pr-android-notif-org-name branch from 130bb4b to 64c06b5 Compare February 13, 2026 12:38
@rajveermalviya
Copy link
Copy Markdown
Member Author

(Rebased to main to fix CI)

Copy link
Copy Markdown
Collaborator

@chrisbobbe chrisbobbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM; marking for Greg's review.

expectedTagComponent: 'stream:${message.streamId}:${message.topic}');
})));

test('stream message: different realms', () => runWithHttpClient(() => awaitFakeAsync((async) async {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "channel message", I think?

Oh I see; there's a strong pattern of saying "stream" in this test's siblings. So "stream" is fine, I think, and we can sweep through later and change them all together (#631).

Comment on lines +431 to +447
..inboxStyle.which((it) => it.isNotNull()
..summaryText.equals(data.realmUrl.toString()))
..inboxStyle.which(
(it) => it.isNotNull()
..summaryText.equals(expectedSummaryText!))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can keep this at two lines instead of three

@chrisbobbe chrisbobbe requested a review from gnprice February 13, 2026 21:42
@chrisbobbe chrisbobbe assigned gnprice and unassigned chrisbobbe Feb 13, 2026
@chrisbobbe chrisbobbe added integration review Added by maintainers when PR may be ready for integration and removed maintainer review PR ready for review by Zulip maintainers labels Feb 13, 2026
Copy link
Copy Markdown
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just nits below, plus the nit Chris pointed out above.

Comment on lines 80 to +83
FcmMessageWithIdentity({
required this.realmUrl,
required this.userId,
required this.realmName,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: let's put realm name next to realm URL, since they're more closely related to each other than either is to the user ID

Comment on lines +153 to +154
check(parse({ ...streamJson }..remove('realm_name')))
.realmName.isNull();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: put this above its two siblings in this test case, because realm_name comes before channel_name or stream in the declarations

..realmUrl.equals(Uri.parse(baseJson['realm_url'] as String))
..realmUrl.equals(Uri.parse(baseJsonPreE2ee['realm_uri'] as String)) // TODO(server-9)
..userId.equals(234)
..realmName.equals(baseBaseJson['realm_name'] as String)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add a similar check in the RemoveFcmMessage tests below, since those objects also gain this field

@rajveermalviya rajveermalviya force-pushed the pr-android-notif-org-name branch from 64c06b5 to b0c9189 Compare February 16, 2026 12:28
@rajveermalviya
Copy link
Copy Markdown
Member Author

Thanks for the reviews @gnprice and @chrisbobbe. @gnprice pushed an update, PTAL.

Zulip Server 8 (FL 234) started sending realmName in the
FCM payload:
  zulip/zulip@a018f2611

So, we try to use the realm name from the account first,
then fallback to notification data, and then finally fallback
to displaying the realm URL.

Fixes: zulip#570
@gnprice
Copy link
Copy Markdown
Member

gnprice commented Feb 18, 2026

Thanks! Looks good; merging.

@gnprice gnprice force-pushed the pr-android-notif-org-name branch from b0c9189 to aacf52a Compare February 18, 2026 00:02
@gnprice gnprice merged commit aacf52a into zulip:main Feb 18, 2026
gnprice added a commit to gnprice/zulip-flutter that referenced this pull request Feb 18, 2026
This was introduced in aacf52a (zulip#2136), after I rebased that PR
and immediately merged.  The rebase went past 5705f83 (zulip#2129),
which had enabled the `use_null_aware_elements` lint rule,
so this was effectively an indirect merge conflict.
Rofumer pushed a commit to Rofumer/zulip-flutter that referenced this pull request Mar 24, 2026
This was introduced in 7584e9f (zulip#2136), after I rebased that PR
and immediately merged.  The rebase went past a82d79b (zulip#2129),
which had enabled the `use_null_aware_elements` lint rule,
so this was effectively an indirect merge conflict.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration review Added by maintainers when PR may be ready for integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

notif: Show organization name, not URL, in collapsed notification

3 participants