Commit e0c5ec8
committed
fix: surface disconnect error instead of queue-closed when deferred already failed
When a client disconnects while a request is pending, disconnect() fails the
deferred with PreviewAutomationClientDisconnectedError before shutting down the
queue. If invoke()'s Queue.offer then observes the shutdown, it would previously
return PreviewAutomationRequestQueueClosedError, masking the more specific
disconnect error already recorded on the deferred.
Use Deferred.poll to check whether the deferred was already completed before
falling back to the queue-closed error, ensuring callers receive the correct
PreviewAutomationClientDisconnectedError.1 parent 472d593 commit e0c5ec8
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
378 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
379 | 383 | | |
380 | 384 | | |
381 | 385 | | |
| |||
0 commit comments