clean up promises when client disconnects

This commit is contained in:
2026-04-23 09:43:08 -05:00
parent 82a462ee11
commit 711c22a9e5
2 changed files with 14 additions and 0 deletions
+7
View File
@@ -36,6 +36,13 @@ export class TetherClient {
}));
});
};
this.websocketHandler.onClose = () => {
this.pendingMutations.forEach(pending => {
clearTimeout(pending.timeoutId);
pending.reject(new Error('Connection closed'));
});
this.pendingMutations.clear();
};
};
disconnect = () => {