Skip to content

Commit b53ec21

Browse files
committed
Better comments
1 parent 1171ed9 commit b53ec21

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

tests/msc2716_test.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -973,28 +973,31 @@ func TestImportHistoricalMessages(t *testing.T) {
973973
// Join the room from a remote homeserver after the historical messages were sent
974974
remoteCharlie.JoinRoom(t, roomID, []string{"hs1"})
975975

976-
// Make a /context request for eventIDAfter to get pagination token before the marker event
976+
// From the remote user, make a /context request for eventIDAfter to get
977+
// pagination token before the marker event
977978
contextRes := remoteCharlie.MustDoFunc(t, "GET", []string{"_matrix", "client", "r0", "rooms", roomID, "context", eventIDAfter}, client.WithContentType("application/json"), client.WithQueries(url.Values{
978979
"limit": []string{"0"},
979980
}))
980981
contextResResBody := client.ParseJSON(t, contextRes)
981982
paginationTokenBeforeMarker := client.GetJSONFieldStr(t, contextResResBody, "end")
982983

983-
// Start /messages request from that pagination token which skips over
984-
// the marker event in the timeline.
984+
// Start the /messages request from that pagination token which
985+
// jumps/skips over the marker event in the timeline. This is the key
986+
// part of the test. We want to make sure that new marker state can be
987+
// injested and processed to reveal the imported history after a
988+
// remote-join without paginating and backfilling over the spot in the
989+
// timeline with the marker event.
985990
//
986-
// FIXME: In the future, we should probably replace the following logic
987-
// with `validateBatchSendRes` to re-use and have some more robust
988-
// assertion logic here. We're currently not using it because the
989-
// message order isn't quite perfect when a remote federated homeserver
990-
// gets backfilled. validateBatchSendRes(t, remoteCharlie, roomID,
991-
// batchSendRes, false)
991+
// We don't want to use `validateBatchSendRes(t, remoteCharlie, roomID,
992+
// batchSendRes, false)` here because it tests against the full message
993+
// response and we need to skip past the marker in the timeline.
992994
messagesRes := remoteCharlie.MustDoFunc(t, "GET", []string{"_matrix", "client", "r0", "rooms", roomID, "messages"}, client.WithContentType("application/json"), client.WithQueries(url.Values{
993995
"dir": []string{"b"},
994996
"limit": []string{"100"},
995997
"from": []string{paginationTokenBeforeMarker},
996998
}))
997999

1000+
// Make sure all of the historical events are present
9981001
must.MatchResponse(t, messagesRes, match.HTTPResponse{
9991002
JSON: []match.JSON{
10001003
match.JSONCheckOffAllowUnwanted("chunk", makeInterfaceSlice(historicalEventIDs), func(r gjson.Result) interface{} {

0 commit comments

Comments
 (0)