Skip to content

Commit 028abb8

Browse files
Add tests to verify ?chunk_id actually corresponds to an insertion event that exists (MSC2716) (#203)
Add tests for matrix-org/synapse#10776
1 parent f58adb0 commit 028abb8

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/msc2716_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,29 @@ func TestBackfillingHistory(t *testing.T) {
345345
)
346346
})
347347

348+
t.Run("Unrecognised chunk_id will throw an error", func(t *testing.T) {
349+
t.Parallel()
350+
351+
roomID := as.CreateRoom(t, createPublicRoomOpts)
352+
alice.JoinRoom(t, roomID, nil)
353+
354+
eventIDsBefore := createMessagesInRoom(t, alice, roomID, 1)
355+
eventIdBefore := eventIDsBefore[0]
356+
timeAfterEventBefore := time.Now()
357+
358+
batchSendHistoricalMessages(
359+
t,
360+
as,
361+
roomID,
362+
eventIdBefore,
363+
"XXX_DOES_NOT_EXIST_CHUNK_ID",
364+
createJoinStateEventsForBackfillRequest([]string{virtualUserID}, timeAfterEventBefore),
365+
createMessageEventsForBackfillRequest([]string{virtualUserID}, timeAfterEventBefore, 1),
366+
// Status
367+
400,
368+
)
369+
})
370+
348371
t.Run("Normal users aren't allowed to backfill messages", func(t *testing.T) {
349372
t.Parallel()
350373

0 commit comments

Comments
 (0)