Skip to content

Feature : Report room #4654

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 34 commits into from
May 2, 2025
Merged

Feature : Report room #4654

merged 34 commits into from
May 2, 2025

Conversation

ganfra
Copy link
Member

@ganfra ganfra commented Apr 28, 2025

Content

This PR allows to report an invite and a room, through different entry points.
For now the feature is disabled, if you want to test you need to override the MatrixConfiguration.CAN_REPORT_ROOM.
In the future we'll be using this PR in the sdk to check if the api is supported, so we use different flows.

Motivation and context

Closes #4315
Closes #4438

Screenshots / GIFs

Tests

  • Make sure MatrixConfiguration.CAN_REPORT_ROOM is enabled or not, depending on your tests

For report room :

  • Long click on RoomList item to see context menu with report room entry
  • Click on report
  • See the new screen.

For report invite :

  • Click on decline button from RoomList item
  • See the new bottomsheet => click on decline and block
  • See the new screen

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 24
  • 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
  • You've made a self review of your PR

@ganfra ganfra added PR-Feature For a new feature Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. labels Apr 28, 2025
@github-actions github-actions bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Apr 28, 2025
@ElementBot
Copy link
Collaborator

ElementBot commented Apr 28, 2025

Warnings
⚠️

libraries/ui-strings/src/main/res/values-cs/translations.xml#L5 - For locale "cs" (Czech) the following quantity should also be defined: many (e.g. "10.0 dne")

⚠️

libraries/ui-strings/src/main/res/values-cs/translations.xml#L25 - For locale "cs" (Czech) the following quantity should also be defined: many (e.g. "10.0 dne")

⚠️

libraries/ui-strings/src/main/res/values-cs/translations.xml#L203 - For locale "cs" (Czech) the following quantity should also be defined: many (e.g. "10.0 dne")

⚠️

libraries/ui-strings/src/main/res/values-cs/translations.xml#L232 - For locale "cs" (Czech) the following quantity should also be defined: many (e.g. "10.0 dne")

⚠️

libraries/ui-strings/src/main/res/values-cs/translations.xml#L364 - For locale "cs" (Czech) the following quantity should also be defined: many (e.g. "10.0 dne")

⚠️

libraries/ui-strings/src/main/res/values-sk/translations.xml#L5 - For locale "sk" (Slovak) the following quantity should also be defined: many (e.g. "10.0 dňa")

⚠️

libraries/ui-strings/src/main/res/values-sk/translations.xml#L25 - For locale "sk" (Slovak) the following quantity should also be defined: many (e.g. "10.0 dňa")

⚠️

libraries/ui-strings/src/main/res/values-sk/translations.xml#L203 - For locale "sk" (Slovak) the following quantity should also be defined: many (e.g. "10.0 dňa")

⚠️

libraries/ui-strings/src/main/res/values-sk/translations.xml#L232 - For locale "sk" (Slovak) the following quantity should also be defined: many (e.g. "10.0 dňa")

⚠️

libraries/ui-strings/src/main/res/values-sk/translations.xml#L364 - For locale "sk" (Slovak) the following quantity should also be defined: many (e.g. "10.0 dňa")

Generated by 🚫 dangerJS against 6ca22ef

Copy link
Contributor

github-actions bot commented Apr 28, 2025

📱 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/3VKJ2t

Copy link

codecov bot commented Apr 28, 2025

Codecov Report

Attention: Patch coverage is 89.61268% with 59 lines in your changes missing coverage. Please review.

Project coverage is 80.11%. Comparing base (baa9f01) to head (6ca22ef).
Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
...vite/impl/acceptdecline/AcceptDeclineInviteView.kt 56.25% 5 Missing and 2 partials ⚠️
...ment/android/features/invite/impl/DeclineInvite.kt 83.87% 1 Missing and 4 partials ⚠️
...ent/android/features/roomlist/impl/RoomListView.kt 37.50% 4 Missing and 1 partial ⚠️
...android/libraries/matrix/impl/room/RustBaseRoom.kt 0.00% 5 Missing ⚠️
.../element/android/features/invite/api/InviteData.kt 71.42% 2 Missing and 2 partials ⚠️
...ent/android/features/reportroom/impl/ReportRoom.kt 78.94% 2 Missing and 2 partials ⚠️
...android/features/reportroom/impl/ReportRoomView.kt 93.44% 1 Missing and 3 partials ⚠️
...eclineandblock/DefaultDeclineAndBlockEntryPoint.kt 0.00% 3 Missing ⚠️
...id/features/reportroom/impl/ReportRoomPresenter.kt 90.00% 2 Missing and 1 partial ⚠️
...eatures/roomlist/impl/RoomListDeclineInviteMenu.kt 94.00% 0 Missing and 3 partials ⚠️
... and 12 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4654      +/-   ##
===========================================
+ Coverage    80.01%   80.11%   +0.10%     
===========================================
  Files         2107     2123      +16     
  Lines        55838    56235     +397     
  Branches      6972     7007      +35     
===========================================
+ Hits         44678    45052     +374     
- Misses        8765     8774       +9     
- Partials      2395     2409      +14     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ganfra ganfra added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Apr 29, 2025
@github-actions github-actions bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Apr 29, 2025
@ganfra ganfra force-pushed the feature/fga/report_room branch from 91f11c0 to 2630797 Compare April 29, 2025 19:05
@ganfra ganfra added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Apr 29, 2025
@ganfra ganfra added Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. and removed Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. labels Apr 29, 2025
@github-actions github-actions bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Apr 29, 2025
@ganfra ganfra marked this pull request as ready for review April 29, 2025 19:21
@ganfra ganfra requested a review from a team as a code owner April 29, 2025 19:21
@ganfra ganfra requested review from jmartinesp and removed request for a team April 29, 2025 19:21
@bmarty bmarty requested review from bmarty and removed request for jmartinesp April 30, 2025 09:35
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, just a few remarks but nothing blocking I think.

if (userIdToBlock != null) {
client
.ignoreUser(userIdToBlock)
.onFailure { return Result.failure(DeclineInvite.Exception.BlockUserFailed) }
Copy link
Member

Choose a reason for hiding this comment

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

If I am reading this properly, if there is an error here, the room will not be reported, and the user will not be able to do it again since the room has been left successfully. Is it OK?

We should maybe try to report the room, and return the error after?

Copy link
Member

Choose a reason for hiding this comment

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

I keep this one for later.

@bmarty bmarty added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label May 2, 2025
@github-actions github-actions bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label May 2, 2025
Copy link

sonarqubecloud bot commented May 2, 2025

@bmarty bmarty merged commit 0b83e66 into develop May 2, 2025
31 checks passed
@bmarty bmarty deleted the feature/fga/report_room branch May 2, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Feature For a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task] Report an invite [Task] Report a room
3 participants