mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-10-01 13:29:02 -05:00
[Client] Release room-join join markers when a command times out (#7348)
RemoteClient's ping sweep deleted timed-out pending commands without emitting finished, so TabServer's in-flight room-join markers were never released: the room stayed silently unjoinable for the rest of the session even though the connection stayed alive. Answer swept commands with RespNotConnected instead of dropping them, matching the disconnect cleanup, so every awaiter gets a deterministic terminal response. Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
@@ -559,6 +559,15 @@ void RemoteClient::ping()
|
||||
PendingCommand *pend = i.next().value();
|
||||
if (pend->tick() > maxTimeout) {
|
||||
i.remove();
|
||||
// Answer the command instead of dropping it silently: the connection may still
|
||||
// be alive (other traffic keeps lastDataReceived fresh) while this single
|
||||
// command stalled, and awaiters such as TabServer's room-join dedup can only
|
||||
// release their in-flight markers when `finished` fires. A silent drop wedges
|
||||
// them permanently - e.g. a room whose join timing never surfaces again.
|
||||
Response response;
|
||||
response.set_response_code(Response::RespNotConnected);
|
||||
response.set_cmd_id(pend->getCommandContainer().cmd_id());
|
||||
pend->processResponse(response);
|
||||
pend->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user