location_scouts and a few others have a loop of this form:
while let Some(response) = self.recv().await? {
match response {
ServerMessage::LocationInfo(items) => return Ok(items),
resp => self.message_buffer.push(resp),
}
}
The bug is that self.recv() will return anything out of message_buffer before it reads anything from the WebSocket - so if there's already an unrelated message in the buffer when location_scouts is called, it just keeps pulling that message out of and into the buffer, never reading the actual response from the WebSocket.
location_scouts
and a few others have a loop of this form:The bug is that
self.recv()
will return anything out of message_buffer before it reads anything from the WebSocket - so if there's already an unrelated message in the buffer whenlocation_scouts
is called, it just keeps pulling that message out of and into the buffer, never reading the actual response from the WebSocket.