matrix-org / matrix-org/matrix-rust-sdk

Enqueuing the sending of read receipts / unread markers while offline

Open
#5,115 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Read receipts
Dominant language
Rust
Stars
2.3k
Forks
500
Avg merge
1d 16h
Merged PRs (30d)
106

Description

Consider the following scenario:

1. I have some unread messages in a room
2. I lose network connection
3. While offline, I open the room to read the messages I received previously
4. Any attempt to send read receipts or update unread markers fails due to lack of connectivity
5. I leave the room's timeline
6. Some time afterwards I regain network access
7. The room will continue to show as unread even though I have read it

It would be helpful if clients could enqueue the sending of read receipts to happen whenever the network is available. I'm interested in discussing if and how this might be possible.

Naively, I have considered pushing the sending of receipts through the send queue. Receipts are not room events, however, and I'm unsure if we'd really want them to mingle with the linearised handling of events?

Apart from this, two immediate complications I foresee:

1. We'd need a local echo for read receipts (see also https://github.com/matrix-org/matrix-rust-sdk/issues/4970)
2. Enqueuing a receipt can invalidate an enqueued earlier receipt. This is probably less involved than 1. and in a send queue implementation might fit into `canonicalize_dependent_requests`.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the send queue and the canonicalize_dependent_requests entry point mentioned in the issue, then review the linked local-echo issue. The scope is still exploratory: done would require an agreed design for offline receipt queuing, local echo behavior, and invalidation of superseded receipts.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.