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 @room mentions crashing in debug builds #3107

Merged
merged 2 commits into from
Jun 27, 2024

Conversation

jmartinesp
Copy link
Member

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Skip the room member cache if the rawValue (original text) of the mention is @room.

Motivation and context

@room is not a valid UserId and incorrectly trying to parse it as so caused a crash in debug builds.

Tests

With a debug build:

  • Open a room where you can mention everyone with @room.
  • Enable text formatting.
  • Add an @room mention.

If it doesn't crash it's fixed.

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

@jmartinesp jmartinesp requested a review from a team as a code owner June 27, 2024 13:52
@jmartinesp jmartinesp requested review from bmarty and removed request for a team June 27, 2024 13:52
Copy link
Contributor

github-actions bot commented Jun 27, 2024

📱 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/pUo1UF

Copy link

codecov bot commented Jun 27, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 75.96%. Comparing base (ed00ed4) to head (bc967fe).

Files Patch % Lines
...ries/textcomposer/model/MarkdownTextEditorState.kt 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3107      +/-   ##
===========================================
- Coverage    75.96%   75.96%   -0.01%     
===========================================
  Files         1636     1636              
  Lines        38618    38617       -1     
  Branches      7465     7463       -2     
===========================================
- Hits         29338    29335       -3     
- Misses        5392     5393       +1     
- Partials      3888     3889       +1     

☔ 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.

Thanks!

@jmartinesp jmartinesp added the PR-Bugfix For bug fix label Jun 27, 2024
@jmartinesp jmartinesp force-pushed the fix/jme/at-room-mention-crashing-on-debug-builds branch from 1eb0c9b to bc967fe Compare June 27, 2024 14:39
Copy link

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.

Thanks for the new MentionSpan.Type.EVERYONE!

@jmartinesp jmartinesp enabled auto-merge (squash) June 27, 2024 15:16
@jmartinesp jmartinesp added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jun 27, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jun 27, 2024
@jmartinesp jmartinesp merged commit d6b259b into develop Jun 27, 2024
26 of 27 checks passed
@jmartinesp jmartinesp deleted the fix/jme/at-room-mention-crashing-on-debug-builds branch June 27, 2024 15:31
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