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

Implement MSC3981 in matrix-react-sdk #25021

Closed
Tracked by #24392
Johennes opened this issue Apr 3, 2023 · 0 comments · Fixed by matrix-org/matrix-js-sdk#3248
Closed
Tracked by #24392

Implement MSC3981 in matrix-react-sdk #25021

Johennes opened this issue Apr 3, 2023 · 0 comments · Fixed by matrix-org/matrix-js-sdk#3248
Assignees
Labels
A-Notifications O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Task Tasks for the team like planning Team: App

Comments

@Johennes
Copy link
Contributor

Johennes commented Apr 3, 2023

Implement MSC3981 in matrix-react-sdk.

We construct a call to the relations API in matrix-js-sdk/src/client.ts, line 7895, in fetchRelations():

let templatedUrl = "/rooms/$roomId/relations/$eventId";
...
const path = utils.encodeUri(templatedUrl + "?" + queryString, {

fetchRelations is called from getThreadTimeline in client.ts line 5702. This is where we pass in the parameter that gets converted into queryParams. There are 4 calls in here e.g.:

const resNewer: IRelationsResponse = await this.fetchRelations(
    timelineSet.room.roomId,
    thread.id,
    THREAD_RELATION_TYPE.name,
    null,
    { dir: Direction.Forward, from: res.end },
);

We also call fetchRelations in paginateEventTimeline in client.ts line 6119, which is also relevant.

getLatestTimeline might also need changing.

In each of these calls we should pass the org.matrix.msc3981.recurse=true param (later it will be recurse=true).

What we need to do:

  • Check whether the server has this feature enabled
  • If so, pass this flag to the relations API during thread fetches, and don't do the whole thread.processEvent -> fetchEditsWhereNeeded stuff - instead it's much simpler - just one call to fetchRelations. Also remove this processEvent calls from thread.addEvent.
@Johennes Johennes added T-Task Tasks for the team like planning A-Notifications Team: App labels Apr 3, 2023
@andybalaam andybalaam added S-Major Severely degrades major functionality or product features, with no satisfactory workaround O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience labels Apr 3, 2023
su-ex added a commit to SchildiChat/matrix-js-sdk that referenced this issue Jul 31, 2023
* Deprecate MatrixClient::resolveRoomAlias ([\matrix-org#3316](matrix-org#3316)).
* add client method to remove pusher ([\matrix-org#3324](matrix-org#3324)). Contributed by @kerryarchibald.
* Implement MSC 3981 ([\matrix-org#3248](matrix-org#3248)). Fixes element-hq/element-web#25021. Contributed by @justjanne.
* Added `Room.getLastLiveEvent` and `Room.getLastThread`. Deprecated `Room.lastThread` in favour of `Room.getLastThread`. ([\matrix-org#3321](matrix-org#3321)).
* Element-R: wire up device lists ([\matrix-org#3272](matrix-org#3272)). Contributed by @florianduros.
* Node 20 support ([\matrix-org#3302](matrix-org#3302)).
* Fix racing between one-time-keys processing and sync ([\matrix-org#3327](matrix-org#3327)). Fixes element-hq/element-web#25214. Contributed by @florianduros.
* Fix lack of media when a user reconnects ([\matrix-org#3318](matrix-org#3318)).
* Fix TimelineWindow getEvents exploding if no neigbouring timeline ([\matrix-org#3285](matrix-org#3285)). Fixes element-hq/element-web#25104.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Notifications O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Task Tasks for the team like planning Team: App
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants