Merge pull request #360 from matrix-org/dmr/invalidate-token-mutex

This commit is contained in:
David Robertson 2023-11-02 14:34:26 +00:00 committed by GitHub
commit 13d4e0278d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,8 +99,10 @@ func (s *testV2Server) addAccountWithDeviceID(userID, deviceID, token string) {
// like invalidateToken, but doesn't do any waiting.
func (s *testV2Server) invalidateTokenImmediately(token string) {
s.mu.Lock()
delete(s.tokenToUser, token)
delete(s.tokenToDevice, token)
s.mu.Unlock()
}
// remove the token and wait until the proxy sends a request with this token, then 401 it and return.