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

Improve hasUserReadEvent and getUserReadUpTo realibility with threads #3031

Merged
merged 29 commits into from
Jan 11, 2023

Conversation

germain-gg
Copy link
Contributor

@germain-gg germain-gg commented Jan 5, 2023

Fixes element-hq/element-web#24164
Helps solving element-hq/element-web#23907

Marks all threads before the first threaded read receipts in a room as read. deals with threads that have no read receipts by checking the room unthreaded receipt for that user.

Checklist

  • Tests written for new code (and old code if feasible)
  • Linter and other CI checks pass
  • Sign-off given on the changes (see CONTRIBUTING.md)

Here's what your changelog entry will look like:

✨ Features

src/models/room.ts Outdated Show resolved Hide resolved
src/models/room.ts Show resolved Hide resolved
src/models/room.ts Show resolved Hide resolved
src/models/thread.ts Outdated Show resolved Hide resolved
src/models/thread.ts Outdated Show resolved Hide resolved
src/models/thread.ts Outdated Show resolved Hide resolved
src/models/thread.ts Outdated Show resolved Hide resolved
src/models/thread.ts Outdated Show resolved Hide resolved
src/client.ts Outdated Show resolved Hide resolved
Germain and others added 4 commits January 5, 2023 17:24
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
src/models/room.ts Outdated Show resolved Hide resolved
src/models/room.ts Outdated Show resolved Hide resolved
src/models/room.ts Outdated Show resolved Hide resolved
src/models/thread.ts Outdated Show resolved Hide resolved
src/models/thread.ts Outdated Show resolved Hide resolved
src/models/thread.ts Outdated Show resolved Hide resolved
src/models/thread.ts Show resolved Hide resolved
src/models/thread.ts Outdated Show resolved Hide resolved
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems somewhat clearer now - thanks for the updates. Still a few questions though.

src/models/thread.ts Outdated Show resolved Hide resolved
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
@germain-gg
Copy link
Contributor Author

I was struggling to understand how the read receipt information we now track in Room related to the information we already track in ReadReceipt (and, by inheritance, Thread). I still am a bit confused about that, to be honest. Do the receipts in ReadReceipt only include those related to either a particular thread, or no thread at all?

ReadReceipt (which is very ill named, and should be changed, but that won't be part of this PR) is a structure that host all the logic to have a timeline that you want to track read receipts in.
So the main room timeline, or each individual thread.

It's not related to a single read receipt, but it's more the structure to host them, and check the MatrixEvent in a timeline

src/models/thread.ts Outdated Show resolved Hide resolved
src/models/thread.ts Outdated Show resolved Hide resolved
src/models/thread.ts Outdated Show resolved Hide resolved
src/models/thread.ts Outdated Show resolved Hide resolved
Germain and others added 2 commits January 10, 2023 13:50
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
src/models/room.ts Outdated Show resolved Hide resolved
src/models/room.ts Outdated Show resolved Hide resolved
src/models/thread.ts Outdated Show resolved Hide resolved
src/models/thread.ts Outdated Show resolved Hide resolved
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if you agree with my suggestions. Thanks for your perseverance!

Germain and others added 2 commits January 11, 2023 09:42
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
@germain-gg germain-gg merged commit 8e29f8e into develop Jan 11, 2023
@germain-gg germain-gg deleted the gsouquet/better-getreadupto branch January 11, 2023 09:53
su-ex added a commit to SchildiChat/matrix-js-sdk that referenced this pull request Jan 19, 2023
* Remove extensible events v1 field population on legacy events ([\matrix-org#3040](matrix-org#3040)).
* Improve hasUserReadEvent and getUserReadUpTo realibility with threads ([\matrix-org#3031](matrix-org#3031)). Fixes element-hq/element-web#24164.
* Remove video track when muting video ([\matrix-org#3028](matrix-org#3028)). Fixes element-hq/element-call#209.
* Make poll start event type available (PSG-962) ([\matrix-org#3034](matrix-org#3034)).
* Add alt event type matching in Relations model ([\matrix-org#3018](matrix-org#3018)).
* Remove usage of v1 Identity Server API ([\matrix-org#3003](matrix-org#3003)).
* Add `device_id` to `/account/whoami` types ([\matrix-org#3005](matrix-org#3005)).
* Implement MSC3912: Relation-based redactions ([\matrix-org#2954](matrix-org#2954)).
* Introduce a mechanism for using the rust-crypto-sdk ([\matrix-org#2969](matrix-org#2969)).
* Support MSC3391: Account data deletion ([\matrix-org#2967](matrix-org#2967)).
* Fix threaded cache receipt when event holds multiple receipts ([\matrix-org#3026](matrix-org#3026)).
* Fix false key requests after verifying new device ([\matrix-org#3029](matrix-org#3029)). Fixes element-hq/element-web#24167 and element-hq/element-web#23333.
* Avoid triggering decryption errors when decrypting redacted events ([\matrix-org#3004](matrix-org#3004)). Fixes element-hq/element-web#24084.
* bugfix: upload OTKs in sliding sync mode ([\matrix-org#3008](matrix-org#3008)).
* Apply edits discovered from sync after thread is initialised ([\matrix-org#3002](matrix-org#3002)). Fixes element-hq/element-web#23921.
* Sliding sync: Fix issue where no unsubs are sent when switching rooms ([\matrix-org#2991](matrix-org#2991)).
* Threads are missing from the timeline ([\matrix-org#2996](matrix-org#2996)). Fixes element-hq/element-web#24036.
* Close all streams when a call ends ([\matrix-org#2992](matrix-org#2992)). Fixes element-hq/element-call#742.
* Resume to-device message queue after resumed sync ([\matrix-org#2920](matrix-org#2920)). Fixes matrix-org/element-web-rageshakes#17170.
* Fix browser entrypoint ([\matrix-org#3051](matrix-org#3051)). Fixes matrix-org#3013.
* Fix failure to start in firefox private browser ([\matrix-org#3058](matrix-org#3058)). Fixes element-hq/element-web#24216.
* Correctly handle limited sync responses by resetting the thread timeline ([\matrix-org#3056](matrix-org#3056)). Fixes element-hq/element-web#23952.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unread count increments when opening the threads panel
3 participants