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

Loading threads with server-side assistance #2735

Merged
merged 33 commits into from
Oct 28, 2022

Conversation

justjanne
Copy link
Contributor

@justjanne justjanne commented Oct 5, 2022

Type: Enhancement
Related: matrix-org/matrix-react-sdk#9356
Related: #2602

  • Load threads correctly
  • Load threads in thread list correctly
  • Load threads in room timeline correctly
  • Update thread list on changes
  • Update room timeline on changes
  • Ensure backwards compatibility for all changes and fixes
  • Adapt existing tests to new functionality

Here's what your changelog entry will look like:

✨ Features

  • Loading threads with server-side assistance (#2735). Contributed by @justjanne.

@justjanne justjanne force-pushed the justjanne/poc/thread-server-loading branch 9 times, most recently from 917adb1 to 37b5fa0 Compare October 12, 2022 11:22
@justjanne justjanne force-pushed the justjanne/poc/thread-server-loading branch 8 times, most recently from d247b24 to a230981 Compare October 17, 2022 11:54
@justjanne justjanne requested a review from germain-gg October 17, 2022 13:57
toStartOfTimeline: boolean,
) => {
if (timelineSet && thread.rootEvent) {
if (Thread.hasServerSideSupport) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I've recently created feature.ts and it aims to create a support map that is generated when the client is started as I've noticed that a LOT of places were doing a slightly custom check for their own features

@@ -6658,25 +6841,42 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
public async doesServerSupportThread(): Promise<{
Copy link
Contributor

Choose a reason for hiding this comment

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

We can probs replace this by feature.ts. Does not need to happen in this PR

threadUnstable, threadStable,
listUnstable, listStable,
fwdPaginationUnstable, fwdPaginationStable,
] = await Promise.all([
this.doesServerSupportUnstableFeature("org.matrix.msc3440"),
this.doesServerSupportUnstableFeature("org.matrix.msc3440.stable"),
this.doesServerSupportUnstableFeature("org.matrix.msc3856"),
this.doesServerSupportUnstableFeature("org.matrix.msc3856.stable"),
Copy link
Contributor

Choose a reason for hiding this comment

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

the .stable have only been defined for msc3440 as far as I've read

Comment on lines 1202 to +1201
Thread.setServerSideSupport(threads);
Thread.setServerSideListSupport(list);
Thread.setServerSideFwdPaginationSupport(fwdPagination);
Copy link
Contributor

Choose a reason for hiding this comment

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

All of that could be replaced by feature.ts

@justjanne justjanne force-pushed the justjanne/poc/thread-server-loading branch from f988de1 to e84b7ac Compare October 21, 2022 13:13
@justjanne justjanne marked this pull request as ready for review October 28, 2022 01:18
@justjanne justjanne requested a review from a team as a code owner October 28, 2022 01:18
@justjanne justjanne requested review from dbkr and richvdh October 28, 2022 01:18
Copy link
Contributor

@germain-gg germain-gg left a comment

Choose a reason for hiding this comment

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

That looks great! 👏
We can punt the changes to feature.ts in a next iteration of work

@justjanne justjanne merged commit 068fbb7 into develop Oct 28, 2022
@justjanne justjanne deleted the justjanne/poc/thread-server-loading branch October 28, 2022 11:48
su-ex added a commit to SchildiChat/matrix-js-sdk that referenced this pull request Nov 12, 2022
* Loading threads with server-side assistance ([\matrix-org#2735](matrix-org#2735)). Contributed by @justjanne.
* Support sign in + E2EE set up using QR code implementing MSC3886, MSC3903 and MSC3906 ([\matrix-org#2747](matrix-org#2747)). Contributed by @hughns.
* Replace `instanceof Array` with `Array.isArray` ([\matrix-org#2812](matrix-org#2812)). Fixes matrix-org#2811.
* Emit UnreadNotification event on notifications reset ([\matrix-org#2804](matrix-org#2804)). Fixes element-hq/element-web#23590.
* Fix incorrect prevEv being sent in ClientEvent.AccountData events ([\matrix-org#2794](matrix-org#2794)).
* Fix build error caused by wrong ts-strict improvements ([\matrix-org#2783](matrix-org#2783)). Contributed by @justjanne.
* Encryption should not hinder verification ([\matrix-org#2734](matrix-org#2734)).
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.

2 participants