Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
justjanne opened this issue Oct 28, 2022 · 0 comments · Fixed by matrix-org/matrix-js-sdk#2922
Assignees
Labels

Comments

@justjanne
Copy link
Contributor

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

@justjanne justjanne added T-Task Tasks for the team like planning S-Tolerable Low/no impact on users A-Threads T-Enhancement and removed T-Task Tasks for the team like planning labels Oct 28, 2022
@justjanne justjanne self-assigned this Nov 30, 2022
su-ex added a commit to SchildiChat/matrix-js-sdk that referenced this issue Jan 15, 2023
* Process `m.room.encryption` events before emitting `RoomMember` events ([\matrix-org#2914](matrix-org#2914)). Fixes element-hq/element-web#23819.
* Don't expose `calls` on `GroupCall` ([\matrix-org#2941](matrix-org#2941)).
* Support MSC3391: Account data deletion ([\matrix-org#2967](matrix-org#2967)).
* Add a message ID on each to-device message ([\matrix-org#2938](matrix-org#2938)).
* Enable multiple users' power levels to be set at once ([\matrix-org#2892](matrix-org#2892)). Contributed by @GoodGuyMarco.
* Include pending events in thread summary and count again ([\matrix-org#2922](matrix-org#2922)). Fixes element-hq/element-web#23642.
* Make GroupCall work better with widgets ([\matrix-org#2935](matrix-org#2935)).
* Add method to get outgoing room key requests for a given event ([\matrix-org#2930](matrix-org#2930)).
* Fix messages loaded during initial fetch ending up out of order ([\matrix-org#2971](matrix-org#2971)). Fixes element-hq/element-web#23972.
* Fix #23919: Root message for new thread loaded from network ([\matrix-org#2965](matrix-org#2965)). Fixes element-hq/element-web#23919.
* Fix #23916: Prevent edits of the last message in a thread getting lost ([\matrix-org#2951](matrix-org#2951)). Fixes element-hq/element-web#23916 and element-hq/element-web#23942.
* Fix infinite loop when restoring cached read receipts ([\matrix-org#2963](matrix-org#2963)). Fixes element-hq/element-web#23951.
* Don't swallow errors coming from the shareSession call ([\matrix-org#2962](matrix-org#2962)). Fixes element-hq/element-web#23792.
* Make sure that MegolmEncryption.setupPromise always resolves  ([\matrix-org#2960](matrix-org#2960)).
* Do not calculate highlight notifs for threads unknown to the room ([\matrix-org#2957](matrix-org#2957)).
* Cache read receipts for unknown threads ([\matrix-org#2953](matrix-org#2953)).
* bugfix: sliding sync initial room timelines shouldn't notify ([\matrix-org#2933](matrix-org#2933)).
* Redo key sharing after own device verification ([\matrix-org#2921](matrix-org#2921)). Fixes element-hq/element-web#23333.
* Move updated threads to the end of the thread list ([\matrix-org#2923](matrix-org#2923)). Fixes element-hq/element-web#23876.
* Fix highlight notifications increasing when total notification is zero ([\matrix-org#2937](matrix-org#2937)). Fixes element-hq/element-web#23885.
* Fix synthesizeReceipt ([\matrix-org#2916](matrix-org#2916)). Fixes element-hq/element-web#23827 element-hq/element-web#23754 and element-hq/element-web#23847.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant