Skip to content

Commit

Permalink
Remove test that does not pass on any known homeserver
Browse files Browse the repository at this point in the history
  • Loading branch information
hughns committed Feb 23, 2023
1 parent fa693d3 commit f829a94
Showing 1 changed file with 0 additions and 50 deletions.
50 changes: 0 additions & 50 deletions tests/csapi/txnid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,56 +38,6 @@ func mustNotHaveTransactionID(t *testing.T, roomID, eventID string) client.SyncC
})
}

// TestTxnAfterRefresh tests that when a client refreshes its access token,
// it still gets back a transaction ID in the sync response.
func TestTxnAfterRefresh(t *testing.T) {
// Dendrite and Conduit don't support refresh tokens yet.
// The implementation in Synapse is broken: https://github.com/matrix-org/synapse/issues/15141
// Whilst strange that this test is disabled for all homeservers, it remains so that we can confirm when
// Synapse is fixed and could be used by any other homeserver developers in the meantime.
runtime.SkipIf(t, runtime.Dendrite, runtime.Conduit, runtime.Synapse)

deployment := Deploy(t, b.BlueprintCleanHS)
defer deployment.Destroy(t)

deployment.RegisterUser(t, "hs1", "alice", "password", false)

c := deployment.Client(t, "hs1", "")

var refreshToken string
c.UserID, c.AccessToken, refreshToken, c.DeviceID, _ = c.LoginUserWithRefreshToken(t, "alice", "password")

// Create a room where we can send events.
roomID := c.CreateRoom(t, map[string]interface{}{})

// Let's send an event, and wait for it to appear in the sync.
eventID := c.SendEventUnsynced(t, roomID, b.Event{
Type: "m.room.message",
Content: map[string]interface{}{
"msgtype": "m.text",
"body": "first",
},
})

// When syncing, we should find the event and it should have a transaction ID.
token := c.MustSyncUntil(t, client.SyncReq{}, mustHaveTransactionID(t, roomID, eventID))

// Now do the same, but refresh the token before syncing.
eventID = c.SendEventUnsynced(t, roomID, b.Event{
Type: "m.room.message",
Content: map[string]interface{}{
"msgtype": "m.text",
"body": "second",
},
})

// Use the refresh token to get a new access token.
c.AccessToken, refreshToken, _ = c.ConsumeRefreshToken(t, refreshToken)

// When syncing, we should find the event and it should also have a transaction ID.
c.MustSyncUntil(t, client.SyncReq{Since: token}, mustHaveTransactionID(t, roomID, eventID))
}

// TestTxnScopeOnLocalEcho tests that transaction IDs are scoped to the access token, not the device
// on the sync response
func TestTxnScopeOnLocalEcho(t *testing.T) {
Expand Down

0 comments on commit f829a94

Please sign in to comment.