Skip to content

Conversation

@jmartinesp
Copy link
Member

@jmartinesp jmartinesp commented Nov 14, 2025

Content

This fixes sending read receipts in threads.

cc @frebib

Motivation and context

If you opened a thread, previously the app would try to send read receipts for it using the live timeline. As those events aren't really in the live timeline, this would be rejected by the homeserver.

Tests

You'll need 2 clients (EX/EW) with the same account and one with a different account to test it. With threads enabled:

  • From another account, send a message in a thread that this client will receive and take as an unread.
  • With this client, open such thread.
  • From the other client with the same account, check the read receipt is now gone.

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

This fixes sending read receipts in threaded timelines.
@jmartinesp jmartinesp requested a review from a team as a code owner November 14, 2025 11:00
@jmartinesp jmartinesp requested review from bmarty and removed request for a team November 14, 2025 11:00
@jmartinesp jmartinesp added the PR-Bugfix For bug fix label Nov 14, 2025
@jmartinesp
Copy link
Member Author

jmartinesp commented Nov 14, 2025

Note there is a similar issue, causing the live timeline to send an incorrect read receipt when the latest event of the room is in a thread even if there were unread events in the live timeline: similarly, it will try sending a read receipt for a threaded event from the live timeline, but as this event is not in this timeline, the HS will reject it. That will be handled in matrix-org/matrix-rust-sdk#5864 instead.

@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/R3K3ea

@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.63%. Comparing base (7b7c429) to head (8a5cf99).
⚠️ Report is 5 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5731   +/-   ##
========================================
  Coverage    79.63%   79.63%           
========================================
  Files         2431     2431           
  Lines        65261    65263    +2     
  Branches      8332     8332           
========================================
+ Hits         51972    51974    +2     
  Misses       10308    10308           
  Partials      2981     2981           

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

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. I suspect that there are other usage of JoinedRoom.liveTimeline with the same problem.
I see:

  • NotificationBroadcastReceiverHandler.sendMatrixEvent()
  • MediaViewerPresenter.delete()
  • Others that I missed?

There is also maybe on opportunity to create an extension like JoinedRoom.getTimeline(ThreadId?), since the code which either returns the liveTimeline or creates one for thread is the same at several places.

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.

3 participants