From 9429915ddc19133c670dbbf5549155e07abe0057 Mon Sep 17 00:00:00 2001 From: James Berry Date: Wed, 29 Nov 2023 07:50:17 +0000 Subject: [PATCH 1/2] Perhaps this returns deviceId to front end correctly? --- packages/server/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index cd496f2..6478b65 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -411,7 +411,7 @@ const routes = async (fastifyInstance: FastifyInstance) => { const connection = currentConnections[workerId]; const isAllocated = !unallocatedConnections.includes(workerId); - const deviceId = Object.keys(controlConnections).find((deviceId) => workerId.startsWith(deviceId)); + const deviceId = connection.mitm?.deviceId ?? Object.keys(controlConnections).find((deviceId) => workerId.startsWith(deviceId)); return { deviceId, From 2ccceaa254df9c0adf2c2dd1baa0f03b6e5a4caf Mon Sep 17 00:00:00 2001 From: Fabio1988 Date: Wed, 29 Nov 2023 11:54:07 +0100 Subject: [PATCH 2/2] fix: lint --- packages/server/src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index 6478b65..521a9bc 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -411,7 +411,9 @@ const routes = async (fastifyInstance: FastifyInstance) => { const connection = currentConnections[workerId]; const isAllocated = !unallocatedConnections.includes(workerId); - const deviceId = connection.mitm?.deviceId ?? Object.keys(controlConnections).find((deviceId) => workerId.startsWith(deviceId)); + const deviceId = + connection.mitm?.deviceId ?? + Object.keys(controlConnections).find((deviceId) => workerId.startsWith(deviceId)); return { deviceId,