Skip to content

Conversation

@jmartinesp
Copy link
Member

@jmartinesp jmartinesp commented Dec 12, 2025

Content

What the title says. If a room name is empty and we try to use that room name as a label for a shortcut, it will throw an exception that's not caught.

Motivation and context

Fix a crash:

Exception java.lang.IllegalArgumentException: Shortcut must have a non-empty label
  at androidx.core.content.pm.ShortcutInfoCompat$Builder.build (ShortcutInfoCompat.java:919)
  at io.element.android.libraries.push.impl.notifications.conversations.DefaultNotificationConversationService.onSendMessage-L2ILk2A (DefaultNotificationConversationService.kt:119)
  at io.element.android.libraries.push.impl.notifications.conversations.DefaultNotificationConversationService$onSendMessage$1.invokeSuspend (DefaultNotificationConversationService.kt:18)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:34)
  at kotlinx.coroutines.internal.ScopeCoroutine.afterResume (Scopes.kt:35)
  at kotlinx.coroutines.AbstractCoroutine.resumeWith (AbstractCoroutine.kt:101)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:47)
  at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:100)
  at android.os.Handler.handleCallback (Handler.java:958)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:224)
  at android.os.Looper.loop (Looper.java:318)
  at android.app.ActivityThread.main (ActivityThread.java:8772)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:561)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1013)

Tests

To be honest, I'm not sure how to reproduce it: this needs the room to have no name and not auto-create one from existing users. I thought an empty room where you're the only user present would be enough, but in the debugger I see 'Empty room' being the room display name, so I don't really know how you can get in a state where the room name isn't automatically generated and it's just empty.

Tested devices

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

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

@jmartinesp jmartinesp added the PR-Bugfix For bug fix label Dec 12, 2025
@sonarqubecloud
Copy link

@github-actions
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/dgFJbx

@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.38%. Comparing base (c5bb18c) to head (bcb4e45).

Files with missing lines Patch % Lines
...rsations/DefaultNotificationConversationService.kt 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5895      +/-   ##
===========================================
- Coverage    81.38%   81.38%   -0.01%     
===========================================
  Files         2479     2479              
  Lines        66200    66201       +1     
  Branches      8431     8432       +1     
===========================================
  Hits         53876    53876              
  Misses        9221     9221              
- Partials      3103     3104       +1     

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

@jmartinesp jmartinesp marked this pull request as ready for review December 12, 2025 09:25
@jmartinesp jmartinesp requested a review from a team as a code owner December 12, 2025 09:25
@jmartinesp jmartinesp requested review from ganfra and removed request for a team December 12, 2025 09:25
@jmartinesp jmartinesp marked this pull request as draft December 12, 2025 09:30
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