@jcbuisson/express-x 1.6.5 → 1.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/server.mjs +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcbuisson/express-x",
3
- "version": "1.6.5",
3
+ "version": "1.6.6",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "src/index.mjs",
package/src/server.mjs CHANGED
@@ -32,7 +32,7 @@ export function expressX(prisma, options = {}) {
32
32
  }
33
33
 
34
34
  async function cloneConnection(id, connection) {
35
- await prisma.Connection.update({
35
+ return await prisma.Connection.update({
36
36
  where: { id },
37
37
  data: {
38
38
  clientIP: connection.clientIP,
@@ -362,11 +362,12 @@ export function expressX(prisma, options = {}) {
362
362
  app.log('verbose', `cnx-transfer from ${from} to ${to}`)
363
363
  const fromConnection = await getConnection(from)
364
364
  if (!fromConnection) return
365
- await cloneConnection(to, fromConnection)
365
+ const toConnection = await cloneConnection(to, fromConnection)
366
366
  setSocket(to, socket)
367
367
  await deleteConnection(from)
368
368
  // send acknowledge to client
369
- io.emit('cnx-transfer-ack', to)
369
+ // io.emit('cnx-transfer-ack', toConnection.data)
370
+ io.emit('cnx-transfer-ack', toConnection)
370
371
  })
371
372
 
372
373
  /*