Skip to content

Re-Introduce Client-Side "last event" and "reply count" estimates for threads #23642

@justjanne

Description

@justjanne

So, matrix-org/matrix-js-sdk#2735 / matrix-org/matrix-react-sdk#9356 stopped using the clients' own local estimations of what event is the latest, whether you contributed yourself and how many replies exist.

Instead the code now relies on the servers' values. That ensures we always get accurate values, but obviously doesn't work perfectly if there's latency.

It'd be great to reintroduce the client-side computed values, but that previously meant desynced values and flashing estimates. For example:

  1. Thread count is 7. I add a message. Local estimate turns to 8. Client does a request to get the servers' new estimate.
  2. I add a message. Local estimate turns to 9. Client does another request to get the servers' new estimate.
  3. The servers' first estimate returns. Value is set to 8
  4. The servers' second estimate is returned. Value is set to 9

Result: The user has a thread with 7 messages, adds two, and sees the count fluctuate 7 - 8 - 9 - 8 -9. With more inflight messages, this can become even worse.

One potential solution would be to cancel the inflight requests whenever a new request is sent. Another option would be taking the local estimate when starting a new request, comparing it to the result from the servers' response, and only applying the delta (but that's easy to get an even worse desync with).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions