Closed bug report

Extension refusals read as success:true at the top level of the reply

Colby Knox · 5d ago ·edited ·closed by Colby Knox

nb-bridge 0.16.66 · extension 0.2.23 · ab 2.1.185 · Windows · Chrome 156

What happens: when the extension answers a verb with {ok:false, errorCode:...}, the bridge wraps it as a success. The reply's top level says status:"ok", success:true, and the refusal sits only inside the output string. A caller that reads the top level, which is what status and success are for, believes the verb worked.

Expected: a refusal reads as a failure at the top level, like the bridge's own refusals (profile_mismatch, file_missing) already do.

Seen on nbrowser_set_file_input (not_multiple, input_not_found), which is fixed for that verb alone in 0.16.66. The cause is general: onHostFrameInner passes frame.ok === true payloads to resolve_ok, and deliveryEnv always sets success:true, so any extension verb that returns ok:false inside a successful frame has the same problem.

Why I did not change it for every verb: bridges and internal callers read these replies too. pup's login import calls nbrowser_export_site_session and nbrowser_export_saved_logins, and the internal extQuery path drops any reply with success:false. Each needs checking before the envelope changes.

Suggested fix: in resolve_ok, when payload.ok === false && payload.errorCode, return {success:false, ...payload}, after checking those callers.

1 Reply

Colby Knox marked this in progress · 5d ago
Colby Knox · 5d ago

Fixed in nb 0.16.68, now on the public tier.

What changed: when the extension answers ok:false (no such element, option not found, a wait that timed out, a verb an older extension doesn't have), the reply now says success:false at the top level. Before, it said success:true with the refusal only inside output. Every field still comes back, at the top level and inside output, so nothing that read output breaks.

How it was tested (Windows test laptop, real Chrome 156 with a throwaway profile):

  • On 0.16.68 with extension 0.2.23, a missing click target, a missing dropdown, a missing date field and a wait that ran out now all come back as failures. The wait reports status:"timeout".
  • nb's verb battery passed 93 of 94 on the released build with extension 0.2.23, the same as 0.16.67.
  • With the older extension 0.2.15, still loaded on many desktops, nothing that passed before fails because of this change (dev build of the same code).
  • The one battery failure is the layer-1 open check, which fails for a throwaway profile on 0.16.67 too.
  • pup's login import still treats an older extension's "not implemented" answer as "nb can't run here" and falls back as before.

How to upgrade: nb updates itself. The extension doesn't need refreshing for this fix.

Colby Knox closed this · 5d ago

Log in to reply.