fix web-probe observe status null handling
This commit is contained in:
@@ -6882,17 +6882,29 @@ function runNodeWebProbeObserveStatus(options: NodeWebProbeObserveOptions, spec:
|
||||
const result = runTransWorkspaceStdinScript(options.node, spec.workspace, script, options.commandTimeoutSeconds);
|
||||
const status = parseJsonObject(result.stdout);
|
||||
const observerId = webObserveIdFromStatus(status, options);
|
||||
const index = status?.ok !== false && observerId !== null && options.stateDir !== null
|
||||
const statusReadable = status !== null;
|
||||
const ok = result.exitCode === 0 && statusReadable && status.ok !== false;
|
||||
const degradedReason = result.timedOut
|
||||
? "web-probe-command-timeout"
|
||||
: result.exitCode !== 0
|
||||
? "web-probe-observe-status-failed"
|
||||
: !statusReadable
|
||||
? "web-probe-observe-status-unreadable"
|
||||
: typeof status.degradedReason === "string"
|
||||
? status.degradedReason
|
||||
: null;
|
||||
const index = ok && observerId !== null && options.stateDir !== null
|
||||
? upsertWebObserveIndexEntry(webObserveIndexEntryFromOptions(options, spec, observerId, status))
|
||||
: null;
|
||||
return {
|
||||
ok: result.exitCode === 0 && status?.ok !== false,
|
||||
status: result.exitCode === 0 ? "observed" : "blocked",
|
||||
ok,
|
||||
status: ok ? "observed" : "blocked",
|
||||
command: webObserveCommandLabel("status", options),
|
||||
id: observerId,
|
||||
node: options.node,
|
||||
lane: options.lane,
|
||||
workspace: spec.workspace,
|
||||
degradedReason,
|
||||
observer: withWebObserveShortcuts(status, observerId),
|
||||
index,
|
||||
next: observerId === null ? null : webObserveNextCommands(observerId),
|
||||
|
||||
Reference in New Issue
Block a user