Skip to content

Commit cdb9981

Browse files
committed
fix: move publishRpcRequest later in the performRpc call
1 parent 137b942 commit cdb9981

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/room/rpc/client/RpcClientManager.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,6 @@ export default class RpcClientManager extends (EventEmitter as new () => TypedEm
8787
const effectiveTimeoutMs = Math.max(responseTimeoutMs, minEffectiveTimeoutMs);
8888
const id = crypto.randomUUID();
8989

90-
await this.publishRpcRequest(
91-
destinationIdentity,
92-
id,
93-
method,
94-
payload,
95-
effectiveTimeoutMs,
96-
remoteClientProtocol,
97-
);
98-
9990
const completionFuture = new Future<string, RpcError>();
10091

10192
const ackTimeoutId = setTimeout(() => {
@@ -112,6 +103,15 @@ export default class RpcClientManager extends (EventEmitter as new () => TypedEm
112103
participantIdentity: destinationIdentity,
113104
});
114105

106+
await this.publishRpcRequest(
107+
destinationIdentity,
108+
id,
109+
method,
110+
payload,
111+
effectiveTimeoutMs,
112+
remoteClientProtocol,
113+
);
114+
115115
const responseTimeoutId = setTimeout(() => {
116116
this.pendingResponses.delete(id);
117117
completionFuture.reject?.(RpcError.builtIn('RESPONSE_TIMEOUT'));

0 commit comments

Comments
 (0)