Publish the conversation shortcut for rooms you have only received messages in - #7459
Open
hayaksi1 wants to merge 1 commit into
Open
Publish the conversation shortcut for rooms you have only received messages in#7459hayaksi1 wants to merge 1 commit into
hayaksi1 wants to merge 1 commit into
Conversation
Message notifications point at a conversation shortcut so that the system gives them the conversation treatment. The shortcut was only ever published when the user sent a message, so for a room the user has only ever received messages in the notification referred to a shortcut that did not exist. Publish the shortcut from the notification path as well, before the notification is shown. The service method is renamed to onMessageInRoom since it is no longer only about sending.
Contributor
|
Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #7459 +/- ##
===========================================
- Coverage 80.65% 80.64% -0.01%
===========================================
Files 2772 2772
Lines 80803 80811 +8
Branches 11053 11053
===========================================
- Hits 65168 65167 -1
- Misses 11370 11381 +11
+ Partials 4265 4263 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Content
NotificationCreatorsets a shortcut id on every message notification so the system gives it the conversation treatment — its own section in the shade, bubbles, conversation-specific settings. The shortcut that id points at is only ever published fromMessageComposerPresenter, when the user sends a message. For any room the user has only ever received messages in, the notification therefore references a shortcut that was never created, and the conversation treatment is silently not applied.Publish the shortcut from the notification path as well, once per room and before the notification is shown, so the id always resolves.
DefaultNotificationConversationServicealready skips publishing when a PIN code is set, so the privacy behaviour is unchanged, and republishing an existing shortcut is an update rather than a duplicate.The service method is renamed from
onSendMessagetoonMessageInRoom, since it is no longer only about sending.This closes the notification half of the issue. Publishing the whole room list as shortcuts, in room-list order, plus Direct Share targets, is a separate and much larger piece of work.
Motivation and context
Part of #1586.
Tests
libraries/push/impl/.../NotificationRendererTest.kt: rendering room message notifications publishes one conversation shortcut per room, and rendering a notification that is not a room message publishes none.FakeNotificationConversationServicegains an optional lambda so tests can observe what was published.Run with
./gradlew :libraries:push:impl:testDebugUnitTest.Tested devices
Checklist