Skip to content

Commit c4c9386

Browse files
SERDUNclaude
andcommitted
fix: clean up transaction on send failure in _executeTransaction
Move _addMessage inside the try-catch block so that if writing to a closed socket throws WebtritSignalingBadStateException, the transaction is properly removed from the _transactions map instead of leaking. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e996731 commit c4c9386

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/webtrit_signaling/lib/src/webtrit_signaling_client.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ class WebtritSignalingClient {
248248
requestJson['transaction'] = transaction.id;
249249
}
250250

251-
_addMessage(requestJson);
252-
253251
try {
252+
_addMessage(requestJson);
253+
254254
final responseJson = await transaction.future;
255255
if (transaction.isIdGenerate) {
256256
responseJson.remove('transaction');

0 commit comments

Comments
 (0)