File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
dotnet/src/webdriver/BiDi/Communication Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,8 @@ private async Task ReceiveMessagesAsync(CancellationToken cancellationToken)
140140 var messageSuccess = JsonSerializer . Deserialize ( ref utfJsonReader , successCommand . Item1 . ResultType , _jsonSerializerContext ) ;
141141
142142 successCommand . Item2 . SetResult ( messageSuccess ) ;
143+
144+ _pendingCommands . TryRemove ( successId , out _ ) ;
143145 break ;
144146
145147 case "event" :
@@ -166,6 +168,7 @@ private async Task ReceiveMessagesAsync(CancellationToken cancellationToken)
166168 var messageError = JsonSerializer . Deserialize ( ref utfJsonReader , _jsonSerializerContext . MessageError ) ;
167169 var errorCommand = _pendingCommands [ messageError . Id ] ;
168170 errorCommand . Item2 . SetException ( new BiDiException ( $ "{ messageError . Error } : { messageError . Message } ") ) ;
171+ _pendingCommands . TryRemove ( messageError . Id , out _ ) ;
169172 break ;
170173 }
171174 }
You can’t perform that action at this time.
0 commit comments