Fix threaded reply playwright tests (#12070)
It appears the bug with these tests was just that the MessageBuilder wasn't setting the thread relation on the reply messages as this didn't happen trying to repro it manually, so fix the builder and re-enable the tests. The flip side of this is that it implies buggy clients that don't set thread relations properly will cause stuck notifs in Element Web. I've filed this as https://github.com/element-hq/element-web/issues/26787
This commit is contained in:
@@ -155,10 +155,19 @@ export class MessageBuilder {
|
||||
public async getContent(room: JSHandle<Room>): Promise<Record<string, unknown>> {
|
||||
const ev = await this.messageFinder.getMessage(room, targetMessage, true);
|
||||
return ev.evaluate((ev, newMessage) => {
|
||||
const threadRel =
|
||||
ev.getRelation()?.rel_type === "m.thread"
|
||||
? {
|
||||
rel_type: "m.thread",
|
||||
event_id: ev.getRelation().event_id,
|
||||
}
|
||||
: {};
|
||||
|
||||
return {
|
||||
"msgtype": "m.text",
|
||||
"body": newMessage,
|
||||
"m.relates_to": {
|
||||
...threadRel,
|
||||
"m.in_reply_to": {
|
||||
event_id: ev.getId(),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user