← Commit history

battery: a refusal carries no ok field; assert on errorCode + hint instead

John Lauer ·c4843511b5 ·21d ago ·parent 8e75aa8
1 file changed +2−1
tools/verb-battery.mjs+2−1
@@ -80,7 +80,8 @@ const T = {     const r = o.ok === true ? call('nbrowser_eval', { sessionId: sid, expression: '1+1' }) : {};     if (o.ok === true) call('nbrowser_close_window', { sessionId: sid });     // Either it attached (some builds allow it) or it refused WITH a code - never a bare Chrome string.-    const refusedWell = r.ok === false && !!r.errorCode && !!r._hint;+    // A refusal has no `ok` field at all (success:false + errorCode), so do not test for ok === false.+    const refusedWell = r.ok !== true && !!r.errorCode && !!(r._hint || r.error);     return A(r.ok === true || refusedWell, r.ok === true ? 'page was attachable; nothing to translate' : `refused as ${r.errorCode} with a hint`, JSON.stringify({ ok: r.ok, errorCode: r.errorCode, err: String(r.error || '').slice(0, 90) }));   },   // nb-bridge#53: with several signed-in identities connected, an unnamed open is REFUSED rather than