← Commit history

v0.16.27 (insiders): in the first seconds after a (re)connect, while a connection's origin is still being checked, an unnamed nb verb answers extension_resolving instead of guessing, so it can never land in pup's browser

John Lauer ·b560c16803 ·1mo ago ·parent 99c2fe0
6 files changed +12−8
bin/nb-dashboard+1−1
@@ -20,7 +20,7 @@ const { execFile, spawn } = require('child_process'); const fs = require('fs'); const crypto = require('crypto'); -const VERSION = '0.16.26';           // keep in lockstep with package.json (pkg version)+const VERSION = '0.16.27';           // keep in lockstep with package.json (pkg version) // SEND TO AI IS UN-PARKED (John: "yeah, we are re-enabling the send to ai. it seems to be good now"). // The ah build thread certified the crash family dead on the gate-fixed build and the delivery leg is // proven end to end. The park const is DELETED rather than flipped, so no dead branch can resurrect it.
bridge/BRIDGE_VERSION+1−1
@@ -1 +1 @@-0.16.26\ No newline at end of file+0.16.27\ No newline at end of file
bridge/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "native-browser",   "displayName": "Adom Native Browser",-  "version": "0.16.26",+  "version": "0.16.27",   "expectedExtensionVersion": "0.2.15",   "description": "Drives the user's REAL signed-in Chrome/Edge, in two layers. Layer 1 (nb) needs NOTHING installed and works on any machine: nbrowser_open_os_window (open a URL in the user's real profile, background+flashing, the OAuth/consent path), nbrowser_os_windows, nbrowser_profiles, nbrowser_wake_profile, nbrowser_force_close. Layer 2 (nbe, the Adom Native Browser Extension) unlocks the rest: CDP driving (navigate/click/read/screenshot) inside their logged-in profile. The bridge binds an ephemeral loopback port and the native-messaging host pumps stdio <-> bridge.",   "homepage": "https://wiki.adom.inc/adom/nb-bridge",
bridge/package.json+1−1
@@ -1,6 +1,6 @@ {   "name": "adom-native-browser-bridge",-  "version": "0.16.26",+  "version": "0.16.27",   "private": true,   "description": "Native-browser bridge for Bridge (ab): layer 1 (nb) plus layer 2 via nbe, the Adom Native Browser Extension (Chrome + Edge).",   "main": "server.js",
bridge/server.js+7−3
@@ -164,9 +164,10 @@ const _originInFlight = new WeakSet(); let _originBusy = 0; function classifyConnOrigin(sock, tries) {   if (process.platform !== 'win32' || !sock || sock.destroyed || _originInFlight.has(sock)) return;-  if (_originBusy >= 4) { if ((tries || 0) < 5) setTimeout(() => classifyConnOrigin(sock, (tries || 0) + 1), 2000); return; }+  const giveUp = (why) => { for (const [, c] of conns) if (c.sock === sock && !c.origin) c.origin = { owner: 'unknown', checkedAt: Date.now(), error: why }; };+  if (_originBusy >= 4) { if ((tries || 0) < 5) setTimeout(() => classifyConnOrigin(sock, (tries || 0) + 1), 2000); else giveUp('classifier busy'); return; }   const port = sock.remotePort; let hp = 0; try { hp = hostSrv.address().port; } catch {}-  if (!port || !hp) return;+  if (!port || !hp) return giveUp('no socket ports');   _originInFlight.add(sock); _originBusy++;   const ps = [     `$c = Get-NetTCPConnection -LocalPort ${port} -RemotePort ${hp} -State Established -ErrorAction SilentlyContinue | Select-Object -First 1`,@@ -229,9 +230,12 @@ function targetConn(args) {   }   // No profile named: drive whatever is live, preferring a resolved label but HAPPILY using a pending   // one - it answers exactly the same (see the isPending note). Refusing here was the bug.-  // Never pup's own browser (see isPupConn): an unnamed nb verb means the USER's browser.+  // Never pup's own browser (see isPupConn): an unnamed nb verb means the USER's browser. In the first+  // seconds after a (re)connect the origin is still being checked; if the best candidate is unchecked,+  // answer "resolving" (the caller retries) rather than guess, since that connection may be pup's.   const e = defaultConnEntry();   if (!e) return null;+  if (process.platform === 'win32' && !e[1].origin) return { unresolved: true, pending: userConns().filter(([, c]) => !c.origin).map(([k]) => k) };   return { conn: e[1], key: e[0] }; } // Register a freshly-connected host BEFORE its hello, under a provisional key, so even an old extension
package.json+1−1
@@ -1,6 +1,6 @@ {   "slug": "nb-bridge",-  "version": "0.16.26",+  "version": "0.16.27",   "type": "app",   "title": "NB - Native Browser Bridge",   "description": "This package installs the SKILLS into your container so your AI knows how to drive your real signed-in Chrome and Edge; Bridge loads the bridge runtime itself from the release zip.",