Skip to content

Commit

Permalink
Fix: only delete the client token if we are the owner (#69)
Browse files Browse the repository at this point in the history
Due to concurrency, it can happen that a new token instance took
over the client for the given invite-code. In that case we should
not be deleting it.
  • Loading branch information
TrueBrain authored Oct 3, 2021
1 parent b209b04 commit 1c19702
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion game_coordinator/application/helpers/token_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def __init__(self, application, source, protocol_version, token, server):
self._given_up = False

def delete_client_token(self):
del self._source.client.connections[self._server.server_id]
if self._source.client.connections[self._server.server_id] == self:
del self._source.client.connections[self._server.server_id]

async def connect(self):
self._tracking_number = 1
Expand Down

0 comments on commit 1c19702

Please sign in to comment.