Skip to content

Commit aa6a7ff

Browse files
committed
fix(API): treat failed ps scan as unreliable in diagnostics
scanReliable only checked for processesValue.note (Windows) but not processesValue.error (ps failure in containers). A caught ps failure returns { matches: [], error } without a note, causing the scan to be incorrectly treated as reliable and skipping full-node RPC probes.
1 parent 9b3eb7e commit aa6a7ff

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/routes/diagnostics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export const getDiagnosticsResponse = async ({ readOnly = false } = {}) => {
263263
// If the scan failed or is unsupported (Windows, minimal Docker image
264264
// without ps, /proc restrictions), we can't tell whether the full node
265265
// is running, so default to true and let the RPC timeout be the backstop.
266-
const scanReliable = chiaProcessesRes.ok && !processesValue.note;
266+
const scanReliable = chiaProcessesRes.ok && !processesValue.note && !processesValue.error;
267267
const fullNodeRunningLocally = scanReliable
268268
? processesValue.matches.some((m) => /chia_full_node/i.test(m.command))
269269
: true;

0 commit comments

Comments
 (0)