-
Notifications
You must be signed in to change notification settings - Fork 318
Split notifications for messages in threads #5595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Split notifications for messages in threads #5595
Conversation
c07eab0 to
68fb2fb
Compare
...rc/main/kotlin/io/element/android/libraries/push/api/notifications/NotificationIdProvider.kt
Outdated
Show resolved
Hide resolved
|
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
68fb2fb to
a2fd3e5
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #5595 +/- ##
===========================================
+ Coverage 79.72% 79.78% +0.05%
===========================================
Files 2395 2395
Lines 65012 65078 +66
Branches 8262 8294 +32
===========================================
+ Hits 51831 51920 +89
+ Misses 10224 10189 -35
- Partials 2957 2969 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work, thanks!
A few remarks after a first review.
app/src/main/kotlin/io/element/android/x/intent/DefaultIntentProvider.kt
Outdated
Show resolved
Hide resolved
appnav/src/main/kotlin/io/element/android/appnav/LoggedInFlowNode.kt
Outdated
Show resolved
Hide resolved
...nk/impl/src/main/kotlin/io/element/android/libraries/deeplink/impl/DefaultDeepLinkCreator.kt
Outdated
Show resolved
Hide resolved
...id/libraries/push/impl/notifications/conversations/DefaultNotificationConversationService.kt
Outdated
Show resolved
Hide resolved
...otlin/io/element/android/libraries/push/impl/notifications/factories/PendingIntentFactory.kt
Outdated
Show resolved
Hide resolved
...kotlin/io/element/android/libraries/push/impl/notifications/factories/NotificationCreator.kt
Outdated
Show resolved
Hide resolved
...kotlin/io/element/android/libraries/push/impl/notifications/factories/NotificationCreator.kt
Outdated
Show resolved
Hide resolved
...kotlin/io/element/android/libraries/push/impl/notifications/factories/NotificationCreator.kt
Show resolved
Hide resolved
...n/kotlin/io/element/android/libraries/push/impl/notifications/ActiveNotificationsProvider.kt
Outdated
Show resolved
Hide resolved
a2bb283 to
692635e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the patch to the comment does not work, here it is: attachThread.patch
appnav/src/main/kotlin/io/element/android/appnav/LoggedInFlowNode.kt
Outdated
Show resolved
Hide resolved
| it.conversationTitle = roomName.takeIf { roomIsGroup } | ||
| it.isGroupConversation = roomIsGroup | ||
| it.conversationTitle = if (isThread) { | ||
| stringProvider.getString(CommonStrings.notification_thread_in_room, roomName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c2f84ab to
cfcb821
Compare
tests/testutils/src/main/kotlin/io/element/android/tests/testutils/lambda/Assertions.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question.
|
|
||
| private suspend fun RoomFlowNode.maybeAttachThread(threadId: ThreadId?, focusedEventId: EventId?) { | ||
| if (threadId != null) { | ||
| waitForNavTargetAttached { it is RoomFlowNode.NavTarget.JoinedRoom } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand why this line is necessary (it was not in my patch).
RoomFlowNode.attachThread already contains waitForChildAttached<JoinedRoomFlowNode>(). This is the same thing, no? Or am I missing something? I am getting confused with all those Nodes :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From our EXA devs chat:
there was another interesting bug
LoggedInFlowNode.attachRoomcreates a new RoomFlowNode and waits until aRoomFlowNodeis present
however, what happens if you do this while aRoomFlowNodewas already present? the operation returns the existing one :D
and since that one is about to be disposed, anything pushed into it is ignored
You can test this by removing this code and:
- Opening a room.
- Receiving a notification for a thread while the room is visible (of that room or some other).
- Opening the notification.
Instead of the thread UI being pushed, you'll see the messages screen for that room being pushed, and the thread screen is nowhere to be found. If you attach a debugger, you'll see the attach thread operation does happen... in the previous RoomFlowNode, not the one we just replaced it with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try to repro. But for me the problem you described was fixed by this code:
element-x-android/appnav/src/main/kotlin/io/element/android/appnav/LoggedInFlowNode.kt
Line 521 in cfcb821
| return waitForChildAttached<RoomFlowNode, NavTarget> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have commented out the code and I do not have the issue you describe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry, I thought we were talking about that other one. This one may not be necessary. If it's not in your tests, we can just remove it, since I probably added it to check what was causing the weird navigation and forgot to remove it later.
c5a1b31 to
6a7db17
Compare
|
Failing test is not failing locally... |
…eature flag is enabled. Otherwise, set the `threadId` to null so it'll behave as usual. It's done this way to avoid having to inject `FeatureFlagService` in several places.
…he latest event in the list of messages of the notification tapped
…dId` value, then because of the `focusedEventId` one
This seemed to fix the issue about occasionally missing large icons on my local tests.
…CATION_ID`+ `ForegroundServiceType` is used instead
…ultActiveNotificationsProvider.getMessageNotificationsForRoom`
…vigating to a thread
a109496 to
6a9ca09
Compare
|




Content
Known issues:
Motivation and context
Implements #5581.
Screenshots / GIFs
Tests
Tested devices
Checklist