in lib/eventstream_rpc.ts [495:501]
registerUnclosedOperation(operation: OperationBase) {
if (!this.isConnected() || !this.unclosedOperations) {
throw createRpcError(RpcErrorType.ClientStateError, "Operation registration only allowed when the client is connected");
}
this.unclosedOperations.add(operation);
}