diff --git a/packages/transport/stream/src/__tests__/stream.test.ts b/packages/transport/stream/src/__tests__/stream.test.ts index 9fa8a13a3..6a38fe330 100644 --- a/packages/transport/stream/src/__tests__/stream.test.ts +++ b/packages/transport/stream/src/__tests__/stream.test.ts @@ -175,7 +175,7 @@ describe("streams", function () { let session: TestSessionStream; let streams: ReturnType[]; - beforeAll(async () => {}); + beforeAll(async () => { }); beforeEach(async () => { // 0 and 2 not connected @@ -501,7 +501,7 @@ describe("streams", function () { let session: TestSessionStream; let streams: ReturnType[]; - beforeAll(async () => {}); + beforeAll(async () => { }); beforeEach(async () => { session = await connected(3, { @@ -640,7 +640,7 @@ describe("streams", function () { let streams: ReturnType[]; const data = new Uint8Array([1, 2, 3]); - beforeAll(async () => {}); + beforeAll(async () => { }); beforeEach(async () => { session = await connected(3, { @@ -758,7 +758,7 @@ describe("streams", function () { let streams: ReturnType[]; const data = new Uint8Array([1, 2, 3]); - beforeAll(async () => {}); + beforeAll(async () => { }); beforeEach(async () => { session = await disconnected(5, { @@ -1095,7 +1095,7 @@ describe("streams", function () { let streams: ReturnType[]; let timer: ReturnType; - beforeAll(async () => {}); + beforeAll(async () => { }); beforeEach(async () => { session = await connected(3, { diff --git a/packages/transport/stream/src/index.ts b/packages/transport/stream/src/index.ts index a023ead2c..1172e8896 100644 --- a/packages/transport/stream/src/index.ts +++ b/packages/transport/stream/src/index.ts @@ -1419,9 +1419,9 @@ export abstract class DirectStream< ): Promise<{ promise: Promise }> { const idString = toBase64(message.id); - const ppp = this._ackCallbacks.get(idString); - if (ppp) { - return { promise: ppp.promise }; + const existing = this._ackCallbacks.get(idString); + if (existing) { + return { promise: existing.promise }; } const allAckS: ACK[] = []; diff --git a/packages/transport/stream/src/routes.ts b/packages/transport/stream/src/routes.ts index 14a3bb1d5..8b524bdb5 100644 --- a/packages/transport/stream/src/routes.ts +++ b/packages/transport/stream/src/routes.ts @@ -305,11 +305,11 @@ export class Routes { session ); } + map.delete(target); + return; + } else { + return; } - /* if (map.size === 1) { - this.pendingRoutes.delete(session); - return; - } */ } else { for (const [target, routes] of map) { for (const route of routes) {