@typed-assistant/builder 0.0.87 → 0.0.88
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/setupWebserver.tsx +18 -11
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/setupWebserver.tsx
CHANGED
|
@@ -347,6 +347,7 @@ export const startWebappServer = async ({
|
|
|
347
347
|
})
|
|
348
348
|
|
|
349
349
|
let emptyStringCount = 0
|
|
350
|
+
let outputStreamsEmptyCount = 0
|
|
350
351
|
|
|
351
352
|
// eslint-disable-next-line no-constant-condition
|
|
352
353
|
while (true) {
|
|
@@ -374,6 +375,12 @@ export const startWebappServer = async ({
|
|
|
374
375
|
"Subprocess output streams ended; waiting for restart or new output",
|
|
375
376
|
)
|
|
376
377
|
await new Promise((resolve) => setTimeout(resolve, 1000))
|
|
378
|
+
outputStreamsEmptyCount += 1
|
|
379
|
+
const outputStreamsEmptyMessage = "Process output streams have ended"
|
|
380
|
+
if (outputStreamsEmptyCount === 10) {
|
|
381
|
+
onProcessError(outputStreamsEmptyMessage)
|
|
382
|
+
break
|
|
383
|
+
}
|
|
377
384
|
continue
|
|
378
385
|
}
|
|
379
386
|
|
|
@@ -385,14 +392,16 @@ export const startWebappServer = async ({
|
|
|
385
392
|
}
|
|
386
393
|
if (convertedMessage === "") {
|
|
387
394
|
emptyStringCount += 1
|
|
388
|
-
const emptyStringMessage =
|
|
389
|
-
"Process is returning an empty string"
|
|
395
|
+
const emptyStringMessage = "Process is returning an empty string"
|
|
390
396
|
if (emptyStringCount === 10) {
|
|
391
397
|
onProcessError(emptyStringMessage)
|
|
398
|
+
break
|
|
392
399
|
}
|
|
393
400
|
subscribers.forEach((send) =>
|
|
394
|
-
send(
|
|
395
|
-
|
|
401
|
+
send(
|
|
402
|
+
"Process is returning an empty string. This was the last non-empty message:\n\n" +
|
|
403
|
+
lastMessage,
|
|
404
|
+
),
|
|
396
405
|
)
|
|
397
406
|
logger.fatal(
|
|
398
407
|
{
|
|
@@ -428,13 +437,11 @@ const getLogsFromFile = async ({
|
|
|
428
437
|
}) => {
|
|
429
438
|
try {
|
|
430
439
|
const parsedLimit = Number(limitProp)
|
|
431
|
-
const limit =
|
|
432
|
-
? parsedLimit
|
|
433
|
-
: undefined
|
|
440
|
+
const limit =
|
|
441
|
+
Number.isFinite(parsedLimit) && parsedLimit > 0 ? parsedLimit : undefined
|
|
434
442
|
const parsedOffset = Number(offsetProp)
|
|
435
|
-
const offset =
|
|
436
|
-
? parsedOffset
|
|
437
|
-
: 0
|
|
443
|
+
const offset =
|
|
444
|
+
Number.isFinite(parsedOffset) && parsedOffset >= 0 ? parsedOffset : 0
|
|
438
445
|
|
|
439
446
|
const normalizedFilter = filter?.toLowerCase().trim()
|
|
440
447
|
|
|
@@ -450,7 +457,7 @@ const getLogsFromFile = async ({
|
|
|
450
457
|
return result.concat({
|
|
451
458
|
msg: e instanceof Error ? e.message : "Unknown parse error",
|
|
452
459
|
level: levels.fatal,
|
|
453
|
-
})
|
|
460
|
+
} as LogSchema)
|
|
454
461
|
}
|
|
455
462
|
}, [] as LogSchema[])
|
|
456
463
|
|