Skip to content
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

Fix not being able to decline an invite from the room list #3466

Merged
merged 3 commits into from
Sep 16, 2024

Conversation

jmartinesp
Copy link
Member

Content

  • Use the new RoomListItem.invitedRoom() API to get a room in an invited membership state that won't need a timeline to work.
  • When calling the 'decline invite' APIs using AcceptDeclineInvitePresenter get an invited room instead of the full room and decline the invite.

Motivation and context

Fixes #3407.

Note the implementation is a quick fix and some iteration on this issue is encouraged: ideally, we'd have JoinedRoom and InvitedRoom abstractions that share a minimum of logic, and maybe both implement a simplified MatrixRoom.

Tests

  • Get an invite in the room list.
  • Decline it.
  • Get another invite.
  • Open its preview by tapping on the item.
  • Decline it.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 14

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

At the moment, this is a wrapper that allows us to call `Room.leave()` without having to initialise the room's timeline (which is impossible).
Also, `RustRoomFactory` now has a `createInvitedRoom` method for this.
@jmartinesp jmartinesp added the PR-Bugfix For bug fix label Sep 16, 2024
@jmartinesp jmartinesp requested a review from a team as a code owner September 16, 2024 11:40
@jmartinesp jmartinesp requested review from ganfra and removed request for a team September 16, 2024 11:40
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/bmu7yp

Copy link

sonarcloud bot commented Sep 16, 2024

Copy link

codecov bot commented Sep 16, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.63%. Comparing base (764692b) to head (499aaef).

Files with missing lines Patch % Lines
...vite/impl/response/AcceptDeclineInvitePresenter.kt 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3466   +/-   ##
========================================
  Coverage    82.63%   82.63%           
========================================
  Files         1701     1702    +1     
  Lines        40047    40055    +8     
  Branches      4872     4872           
========================================
+ Hits         33092    33100    +8     
  Misses        5234     5234           
  Partials      1721     1721           

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

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@jmartinesp jmartinesp added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Sep 16, 2024
@jmartinesp jmartinesp enabled auto-merge (squash) September 16, 2024 12:20
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Sep 16, 2024
@jmartinesp jmartinesp merged commit 7238af7 into develop Sep 16, 2024
34 checks passed
@jmartinesp jmartinesp deleted the fix/jme/decline-invites-not-working branch September 16, 2024 13:02
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.

Declining room invites does not work
2 participants