Skip to content

Clear existing notification when a room is marked as read #3203

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

Merged
merged 4 commits into from
Jul 16, 2024

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Jul 16, 2024

Content

First commit are cleanup and small rework.
Last commit is to clear existing notification when a room is marked as read

Motivation and context

Clear existing notification when a room is marked as read (context: #3184)

Screenshots / GIFs

Tests

  • Navigate to the room list
  • Receive a message. A notification is displayed and the room is unread
  • Long click on the room and select "Mark as read"
  • Observe that the room is now read (green dot disappear) and notification is dismissed.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner July 16, 2024 11:13
@bmarty bmarty requested review from ganfra and removed request for a team July 16, 2024 11:13
@@ -268,6 +270,7 @@ class RoomListPresenter @Inject constructor(
}

private fun CoroutineScope.markAsRead(roomId: RoomId) = launch {
notificationCleaner.clearMessagesForRoom(client.sessionId, roomId)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the fix!

Copy link
Contributor

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/iRfy8P

Copy link

Copy link

codecov bot commented Jul 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.14%. Comparing base (544b4a1) to head (85ceb02).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3203   +/-   ##
========================================
  Coverage    76.14%   76.14%           
========================================
  Files         1645     1644    -1     
  Lines        38756    38758    +2     
  Branches      7501     7501           
========================================
+ Hits         29510    29512    +2     
+ Misses        5351     5350    -1     
- Partials      3895     3896    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bmarty bmarty added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jul 16, 2024
@bmarty bmarty enabled auto-merge July 16, 2024 11:36
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jul 16, 2024
@bmarty bmarty added the PR-Bugfix For bug fix label Jul 16, 2024
@bmarty bmarty merged commit d9599a2 into develop Jul 16, 2024
34 checks passed
@bmarty bmarty deleted the feature/bma/clearNotificationWhenMarkAsRead branch July 16, 2024 12:48
clearMessagesForRoomLambda.assertions().isCalledOnce()
.with(value(A_SESSION_ID), value(A_ROOM_ID))
initialState.eventSink.invoke(RoomListEvents.MarkAsUnread(A_ROOM_ID_2))
assertThat(room2.markAsReadCalls).isEqualTo(emptyList<ReceiptType>())
Copy link
Member Author

Choose a reason for hiding this comment

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

Konsist test should have failed here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Bugfix For bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants