1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-04 05:02:41 +03:00

Tweak thread creation & event adding to fix bugs around relations (#2369)

* Remove legacy code which caused threads to begin life with too many events

* Update tests & behaviour
This commit is contained in:
Michael Telatynski
2022-05-16 09:01:39 +01:00
committed by GitHub
parent 3e4f02b41e
commit ba1f6ffc84
3 changed files with 17 additions and 7 deletions

View File

@@ -221,9 +221,10 @@ export class Thread extends TypedEventEmitter<EmittedEvents, EventHandlerMap> {
this._currentUserParticipated = true;
}
// Add all annotations and replace relations to the timeline so that the relations are processed accordingly
if ([RelationType.Annotation, RelationType.Replace].includes(event.getRelation()?.rel_type as RelationType)) {
this.addEventToTimeline(event, toStartOfTimeline);
// Apply annotations and replace relations to the relations of the timeline only
this.timelineSet.setRelationsTarget(event);
this.timelineSet.aggregateRelations(event);
return;
}