Skip to content

Publish the conversation shortcut for rooms you have only received messages in - #7459

Open
hayaksi1 wants to merge 1 commit into
element-hq:developfrom
hayaksi1:fix/1586-publish-conversation-shortcut
Open

Publish the conversation shortcut for rooms you have only received messages in#7459
hayaksi1 wants to merge 1 commit into
element-hq:developfrom
hayaksi1:fix/1586-publish-conversation-shortcut

Conversation

@hayaksi1

Copy link
Copy Markdown
Contributor

Content

NotificationCreator sets a shortcut id on every message notification so the system gives it the conversation treatment — its own section in the shade, bubbles, conversation-specific settings. The shortcut that id points at is only ever published from MessageComposerPresenter, when the user sends a message. For any room the user has only ever received messages in, the notification therefore references a shortcut that was never created, and the conversation treatment is silently not applied.

Publish the shortcut from the notification path as well, once per room and before the notification is shown, so the id always resolves. DefaultNotificationConversationService already skips publishing when a PIN code is set, so the privacy behaviour is unchanged, and republishing an existing shortcut is an update rather than a duplicate.

The service method is renamed from onSendMessage to onMessageInRoom, since it is no longer only about sending.

This closes the notification half of the issue. Publishing the whole room list as shortcuts, in room-list order, plus Direct Share targets, is a separate and much larger piece of work.

Motivation and context

Part of #1586.

Tests

libraries/push/impl/.../NotificationRendererTest.kt: rendering room message notifications publishes one conversation shortcut per room, and rendering a notification that is not a room message publishes none.

FakeNotificationConversationService gains an optional lambda so tests can observe what was published.

Run with ./gradlew :libraries:push:impl:testDebugUnitTest.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • I am aware of the etiquette.
  • This PR was made with the help of AI:
    • Yes. In this case, please request a review by Copilot.
    • No.
  • 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 defines 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

Message notifications point at a conversation shortcut so that the
system gives them the conversation treatment. The shortcut was only ever
published when the user sent a message, so for a room the user has only
ever received messages in the notification referred to a shortcut that
did not exist.

Publish the shortcut from the notification path as well, before the
notification is shown. The service method is renamed to onMessageInRoom
since it is no longer only about sending.
@hayaksi1
hayaksi1 requested a review from a team as a code owner August 17, 2026 08:41
@hayaksi1
hayaksi1 requested review from bmarty and removed request for a team August 17, 2026 08:41
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:

  • If your pull request adds a feature or modifies the UI, this should have an equivalent pull request in the Element X iOS repo unless it only affects an Android-only behaviour or is behind a disabled feature flag, since we need parity in both clients to consider a feature done. It will also need to be approved by our product and design teams before being merged, so it's usually a good idea to discuss the changes in a Github issue first and then start working on them once the approach has been validated.
  • Your branch should be based on origin/develop, at least when it was created.
  • The title of the PR will be used for release notes, so it needs to describe the change visible to the user.
  • The test pass locally running ./gradlew test.
  • The code quality check suite pass locally running ./gradlew runQualityChecks.
  • If you modified anything related to the UI, including previews, you'll have to run the Record screenshots GH action in your forked repo: that will generate compatible new screenshots. However, given Github Actions limitations, it will prevent the CI from running temporarily, until you upload a new commit after that one. To do so, just pull the latest changes and push an empty commit.

@github-actions github-actions Bot added the Z-Community-PR Issue is solved by a community member's PR label Aug 17, 2026
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.64%. Comparing base (1a3b89d) to head (c068ea6).
⚠️ Report is 8 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7459      +/-   ##
===========================================
- Coverage    80.65%   80.64%   -0.01%     
===========================================
  Files         2772     2772              
  Lines        80803    80811       +8     
  Branches     11053    11053              
===========================================
- Hits         65168    65167       -1     
- Misses       11370    11381      +11     
+ Partials      4265     4263       -2     

☔ View full report in Codecov by Harness.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant