Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests to verify ?chunk_id actually corresponds to an insertion event that exists (MSC2716) #203

Merged
merged 19 commits into from
Sep 21, 2021
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
048887b
Update MSC2716 federation test cases
MadLittleMods Jul 23, 2021
d385044
Uncomment some federated test cases
MadLittleMods Jul 26, 2021
493f7ea
Merge branch 'master' into madlittlemods/msc2716-federation-changes
MadLittleMods Jul 29, 2021
faec5ca
More proper waiting to avoid flakey test
MadLittleMods Jul 29, 2021
edade9c
Get both tests working and de-duplicate marker sending verifying
MadLittleMods Jul 29, 2021
b72cc1f
Make error comment match helper function name
MadLittleMods Jul 29, 2021
6bc06f7
Add test for private room backfilling
MadLittleMods Aug 4, 2021
3b2358f
Simplify batchSendHistoricalMessages function signature by using sort…
MadLittleMods Aug 4, 2021
637ac8f
Remove test skips now that it's supported in Synapse
MadLittleMods Aug 10, 2021
b06fc95
Verify we only return state events that we pass in
MadLittleMods Aug 10, 2021
0a215fe
Add tests for MSC2716 being backwards compatible with existing room v…
MadLittleMods Aug 11, 2021
a958b34
Add helper decorations
MadLittleMods Aug 18, 2021
09b4a4b
Add tests to verify ?chunk_id actually corresponds to an insertion ev…
MadLittleMods Sep 7, 2021
858aef6
More idiomatic Go from review
MadLittleMods Sep 8, 2021
de5d68d
Merge branch 'madlittlemods/msc2716-federation-changes' into madlittl…
MadLittleMods Sep 8, 2021
1de9618
Use txn helper for other txns
MadLittleMods Sep 8, 2021
5c642cf
Merge branch 'master' into madlittlemods/msc2716-room-creator-existin…
MadLittleMods Sep 8, 2021
74b6399
Merge branch 'madlittlemods/msc2716-room-creator-existing-room-versio…
MadLittleMods Sep 10, 2021
dee7eec
Merge branch 'master' into madlittlemods/msc2716-verify-params
MadLittleMods Sep 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions tests/msc2716_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,29 @@ func TestBackfillingHistory(t *testing.T) {
)
})

t.Run("Unrecognised chunk_id will throw an error", func(t *testing.T) {
t.Parallel()

roomID := as.CreateRoom(t, createPublicRoomOpts)
alice.JoinRoom(t, roomID, nil)

eventIDsBefore := createMessagesInRoom(t, alice, roomID, 1)
eventIdBefore := eventIDsBefore[0]
timeAfterEventBefore := time.Now()

batchSendHistoricalMessages(
t,
as,
roomID,
eventIdBefore,
"XXX_DOES_NOT_EXIST_CHUNK_ID",
createJoinStateEventsForBackfillRequest([]string{virtualUserID}, timeAfterEventBefore),
createMessageEventsForBackfillRequest([]string{virtualUserID}, timeAfterEventBefore, 1),
// Status
400,
)
})

t.Run("Normal users aren't allowed to backfill messages", func(t *testing.T) {
t.Parallel()

Expand Down