@@ -9,11 +9,13 @@ import (
9
9
)
10
10
11
11
func TestMembersLocal (t * testing.T ) {
12
- deployment := Deploy (t , b .BlueprintOneToOneRoom )
12
+ deployment := Deploy (t , b .BlueprintAlice )
13
13
defer deployment .Destroy (t )
14
14
15
15
alice := deployment .Client (t , "hs1" , "@alice:hs1" )
16
- bob := deployment .Client (t , "hs1" , "@bob:hs1" )
16
+ // Here we don't use the BlueprintOneToOneRoom because else Bob would be able to see Alice's presence changes through
17
+ // that pre-existing one-on-one DM room. So we exclude that here.
18
+ bob := deployment .RegisterUser (t , "hs1" , "bob" , "bobspassword" , false )
17
19
roomID := alice .CreateRoom (t , map [string ]interface {}{"preset" : "public_chat" })
18
20
19
21
bob .MustDoFunc (
@@ -23,7 +25,7 @@ func TestMembersLocal(t *testing.T) {
23
25
}),
24
26
)
25
27
26
- _ , incrementalSyncToken := alice .MustSync (t , client.SyncReq {})
28
+ _ , incrementalSyncTokenBeforeBobJoinsRoom := alice .MustSync (t , client.SyncReq {TimeoutMillis : "0" })
27
29
bob .JoinRoom (t , roomID , []string {})
28
30
29
31
t .Run ("Parallel" , func (t * testing.T ) {
@@ -38,15 +40,17 @@ func TestMembersLocal(t *testing.T) {
38
40
t .Run ("Existing members see new members' join events" , func (t * testing.T ) {
39
41
t .Parallel ()
40
42
// SyncJoinedTo already checks everything we need to know
41
- alice .MustSyncUntil (t , client.SyncReq {}, client .SyncJoinedTo (bob .UserID , roomID ))
43
+ alice .MustSyncUntil (t , client.SyncReq {Since : incrementalSyncTokenBeforeBobJoinsRoom }, client .SyncJoinedTo (bob .UserID , roomID ))
42
44
})
43
45
44
46
// sytest: Existing members see new members' presence
45
47
// Split into initial and incremental sync cases in Complement.
46
- t .Run ("Existing members see new members' presence in initial sync" , func (t * testing.T ) {
47
- runtime .SkipIf (t , runtime .Dendrite ) // FIXME: https://github.com/matrix-org/dendrite /issues/2803
48
+ t .Run ("Existing members see new members' presence ( in initial sync) " , func (t * testing.T ) {
49
+ runtime .SkipIf (t , runtime .Dendrite ) // FIXME: https://github.com/matrix-org/matrix-spec /issues/1374
48
50
t .Parallel ()
51
+ // First we sync to make sure bob to have joined the room...
49
52
alice .MustSyncUntil (t , client.SyncReq {}, client .SyncJoinedTo (bob .UserID , roomID ))
53
+ // ...and then we do another initial sync - this time waiting for bob's presence - to confirm we can get that.
50
54
alice .MustSyncUntil (t , client.SyncReq {},
51
55
client .SyncJoinedTo (bob .UserID , roomID ),
52
56
client .SyncPresenceHas (bob .UserID , nil ),
@@ -55,10 +59,9 @@ func TestMembersLocal(t *testing.T) {
55
59
56
60
// sytest: Existing members see new members' presence
57
61
// Split into initial and incremental sync cases in Complement.
58
- t .Run ("Existing members see new members' presence in incremental sync" , func (t * testing.T ) {
59
- runtime .SkipIf (t , runtime .Dendrite ) // FIXME: https://github.com/matrix-org/dendrite/issues/2803
62
+ t .Run ("Existing members see new members' presence (in incremental sync)" , func (t * testing.T ) {
60
63
t .Parallel ()
61
- alice .MustSyncUntil (t , client.SyncReq {Since : incrementalSyncToken },
64
+ alice .MustSyncUntil (t , client.SyncReq {Since : incrementalSyncTokenBeforeBobJoinsRoom },
62
65
client .SyncJoinedTo (bob .UserID , roomID ),
63
66
client .SyncPresenceHas (bob .UserID , nil ),
64
67
)
0 commit comments