@jcbuisson/express-x 1.5.34 → 1.5.36
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.
- package/package.json +1 -1
- package/src/server.mjs +2 -3
package/package.json
CHANGED
package/src/server.mjs
CHANGED
|
@@ -114,7 +114,6 @@ export function expressX(prisma, options = {}) {
|
|
|
114
114
|
const channelNames = await publishFunc(result, app)
|
|
115
115
|
app.log('verbose', `publish channels ${service.name} ${methodName} ${channelNames}`)
|
|
116
116
|
const connections = await app.prisma.Connection.findMany({})
|
|
117
|
-
console.log('connections', connections)
|
|
118
117
|
for (const channelName of channelNames) {
|
|
119
118
|
app.log('verbose', `service-event ${service.name} ${methodName} ${channelName}`)
|
|
120
119
|
const connectionList = connections.filter(connection => {
|
|
@@ -123,7 +122,7 @@ export function expressX(prisma, options = {}) {
|
|
|
123
122
|
})
|
|
124
123
|
|
|
125
124
|
for (const connection of connectionList) {
|
|
126
|
-
const trimmedResult = JSON.stringify(result).slice(0, 300)
|
|
125
|
+
const trimmedResult = result ? JSON.stringify(result).slice(0, 300) : ''
|
|
127
126
|
app.log('verbose', `emit to ${connection.id} ${service.name} ${methodName} ${trimmedResult}`)
|
|
128
127
|
const socket = cnx2Socket[connection.id]
|
|
129
128
|
console.log()
|
|
@@ -367,7 +366,7 @@ export function expressX(prisma, options = {}) {
|
|
|
367
366
|
|
|
368
367
|
try {
|
|
369
368
|
const result = await serviceMethod(context, ...args)
|
|
370
|
-
const trimmedResult = JSON.stringify(result).slice(0, 300)
|
|
369
|
+
const trimmedResult = result ? JSON.stringify(result).slice(0, 300) : ''
|
|
371
370
|
app.log('verbose', `client-response ${uid} ${trimmedResult}`)
|
|
372
371
|
socket.emit('client-response', {
|
|
373
372
|
uid,
|