fix: prevent 'active request' error from showing blocking error screen (#8398)
Signed-off-by: Michael Neale <michael.neale@gmail.com> Signed-off-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
@@ -130,6 +130,7 @@ impl SessionEventBus {
|
||||
request_id: String,
|
||||
) -> Result<CancellationToken, String> {
|
||||
let mut requests = self.active_requests.lock().await;
|
||||
requests.retain(|_id, token| !token.is_cancelled());
|
||||
if !requests.is_empty() {
|
||||
return Err("Session already has an active request".into());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user