Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
chore: wait for ack requests before shutting transport
Browse files Browse the repository at this point in the history
  • Loading branch information
Gancho Radkov committed Sep 14, 2023
1 parent 21d64c9 commit c6f010c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/auth-client/test/helpers/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { ICore } from "@walletconnect/types";
import EventEmitter from "events";

export async function disconnectSocket(core: ICore) {
// wait a bit for all ACK requests to be processed
await new Promise<void>((resolve) => setTimeout(resolve, 1000));
if (core.relayer.connected) {
core.relayer.provider.events = new EventEmitter();
core.relayer.core.heartbeat.events = new EventEmitter();
Expand Down

0 comments on commit c6f010c

Please sign in to comment.