Fix msgtype changes from edits not rerendering timeline tiles (#33416)

* Fix msgtype changes from edits not rerendering timeline tiles

* Change approach to view model listeners instead

* Repaint the mounted tile on MatrixEventEvent.Replaced
This commit is contained in:
rbondesson
2026-05-08 11:33:23 +02:00
committed by GitHub
parent 1b9c9cb92f
commit a1c1d330e9
5 changed files with 126 additions and 4 deletions
@@ -214,6 +214,35 @@ describe("EventTile", () => {
expect(screen.getByText("Can't load this message (m.room.message)")).toBeInTheDocument();
});
});
it("updates msgtype-derived tile classes when an edit changes msgtype to m.emote", async () => {
const { container } = getComponent();
expect(container.querySelector(".mx_EventTile_emote")).toBeNull();
const edit = new MatrixEvent({
type: EventType.RoomMessage,
room_id: ROOM_ID,
sender: "@alice:example.org",
content: {
"body": "* waves",
"msgtype": "m.emote",
"m.new_content": {
body: "waves",
msgtype: "m.emote",
},
"m.relates_to": {
rel_type: "m.replace",
event_id: mxEvent.getId(),
},
},
});
act(() => {
mxEvent.makeReplaced(edit);
});
await waitFor(() => expect(container.querySelector(".mx_EventTile_emote")).not.toBeNull());
});
});
describe("EventTile in the right panel", () => {