























@@ -590,6 +590,73 @@ describe("matrix live qa scenarios", () => {
590590);
591591});
592592593+it("ignores stale Matrix SUT replies before a no-reply trigger", async () => {
594+const primeRoom = vi.fn().mockResolvedValue("observer-sync-start");
595+const sendTextMessage = vi.fn().mockResolvedValue("$observer-command-trigger");
596+const waitForOptionalRoomEvent = vi.fn().mockImplementation(async (params) => {
597+expect(
598+params.predicate({
599+eventId: "$previous-reply",
600+kind: "message",
601+relatesTo: {
602+eventId: "$previous-trigger",
603+inReplyToId: "$previous-trigger",
604+isFallingBack: true,
605+relType: "m.thread",
606+},
607+roomId: "!main:matrix-qa.test",
608+sender: "@sut:matrix-qa.test",
609+type: "m.room.message",
610+}),
611+).toBe(false);
612+expect(
613+params.predicate({
614+eventId: "$observer-command-trigger",
615+kind: "message",
616+roomId: "!main:matrix-qa.test",
617+sender: "@observer:matrix-qa.test",
618+type: "m.room.message",
619+}),
620+).toBe(false);
621+expect(
622+params.predicate({
623+eventId: "$current-reply",
624+kind: "message",
625+relatesTo: {
626+eventId: "$observer-command-trigger",
627+inReplyToId: "$observer-command-trigger",
628+isFallingBack: true,
629+relType: "m.thread",
630+},
631+roomId: "!main:matrix-qa.test",
632+sender: "@sut:matrix-qa.test",
633+type: "m.room.message",
634+}),
635+).toBe(true);
636+return {
637+matched: false,
638+since: "observer-sync-next",
639+};
640+});
641+642+createMatrixQaClient.mockReturnValue({
643+ primeRoom,
644+ sendTextMessage,
645+ waitForOptionalRoomEvent,
646+});
647+648+const scenario = MATRIX_QA_SCENARIOS.find(
649+(entry) => entry.id === "matrix-mxid-prefixed-command-block",
650+);
651+expect(scenario).toBeDefined();
652+653+await expect(runMatrixQaScenario(scenario!, matrixQaScenarioContext())).resolves.toMatchObject({
654+artifacts: {
655+driverEventId: "$observer-command-trigger",
656+},
657+});
658+});
659+593660it("hot-reloads group allowlist removals inside one running Matrix gateway", async () => {
594661const patchGatewayConfig = vi.fn(async () => {});
595662const primeRoom = vi.fn().mockResolvedValue("sync-start");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。