@@ -575,6 +575,11 @@ func TestImportHistoricalMessages(t *testing.T) {
575
575
)
576
576
batchSendResBody := client .ParseJSON (t , batchSendRes )
577
577
historicalEventIDs := client .GetJSONFieldStringArray (t , batchSendResBody , "event_ids" )
578
+ baseInsertionEventID := client .GetJSONFieldStr (t , batchSendResBody , "base_insertion_event_id" )
579
+
580
+ // Send the marker event which lets remote homeservers know there are
581
+ // some historical messages back at the given insertion event.
582
+ sendMarkerAndEnsureBackfilled (t , as , alice , roomID , baseInsertionEventID )
578
583
579
584
// Join the room from a remote homeserver after the historical messages were sent
580
585
remoteCharlie .JoinRoom (t , roomID , []string {"hs1" })
@@ -654,6 +659,10 @@ func TestImportHistoricalMessages(t *testing.T) {
654
659
batchSendResBody := client .ParseJSON (t , batchSendRes )
655
660
historicalEventIDs := client .GetJSONFieldStringArray (t , batchSendResBody , "event_ids" )
656
661
662
+ // Send the marker event which lets remote homeservers know there are
663
+ // some historical messages back at the given insertion event.
664
+ sendMarkerAndEnsureBackfilled (t , as , alice , roomID , insertionEventID )
665
+
657
666
// Join the room from a remote homeserver after the historical messages were sent
658
667
remoteCharlie .JoinRoom (t , roomID , []string {"hs1" })
659
668
@@ -756,7 +765,8 @@ func TestImportHistoricalMessages(t *testing.T) {
756
765
},
757
766
})
758
767
759
- // Send the marker event
768
+ // Send the marker event which lets remote homeservers know there are
769
+ // some historical messages back at the given insertion event.
760
770
sendMarkerAndEnsureBackfilled (t , as , remoteCharlie , roomID , baseInsertionEventID )
761
771
762
772
// FIXME: In the future, we should probably replace the following logic
@@ -849,7 +859,8 @@ func TestImportHistoricalMessages(t *testing.T) {
849
859
},
850
860
})
851
861
852
- // Send the marker event
862
+ // Send the marker event which lets remote homeservers know there are
863
+ // some historical messages back at the given insertion event.
853
864
sendMarkerAndEnsureBackfilled (t , as , remoteCharlie , roomID , baseInsertionEventID )
854
865
855
866
// FIXME: In the future, we should probably replace the following logic
@@ -959,7 +970,8 @@ func TestImportHistoricalMessages(t *testing.T) {
959
970
batchEventID := client .GetJSONFieldStr (t , batchSendResBody , "batch_event_id" )
960
971
baseInsertionEventID := client .GetJSONFieldStr (t , batchSendResBody , "base_insertion_event_id" )
961
972
962
- // Send the marker event
973
+ // Send the marker event which lets remote homeservers know there are
974
+ // some historical messages back at the given insertion event.
963
975
markerEventID := sendMarkerAndEnsureBackfilled (t , as , alice , roomID , baseInsertionEventID )
964
976
965
977
redactEventID (t , alice , roomID , insertionEventID , 403 )
@@ -1110,11 +1122,11 @@ func ensureVirtualUserRegistered(t *testing.T, c *client.CSAPI, virtualUserLocal
1110
1122
}
1111
1123
}
1112
1124
1125
+ // Send the marker event which lets remote homeservers know there are
1126
+ // some historical messages back at the given insertion event.
1113
1127
func sendMarkerAndEnsureBackfilled (t * testing.T , as * client.CSAPI , c * client.CSAPI , roomID , insertionEventID string ) (markerEventID string ) {
1114
1128
t .Helper ()
1115
1129
1116
- // Send a marker event to let all of the homeservers know about the
1117
- // insertion point where all of the historical messages are at
1118
1130
markerEvent := b.Event {
1119
1131
Type : markerEventType ,
1120
1132
Content : map [string ]interface {}{
0 commit comments