← Commit history

bridge 0.0.29: fix Chrome-install toast storm - fire the approval toast ONCE (sticky), re-notify only after an actual tap whose UAC failed; no timer re-arm, no peer pings

John Lauer ·60ce382022 ·4mo ago ·parent 5ab1f56
5 files changed +29−25
bridge/BRIDGE_VERSION+1−1
@@ -1 +1 @@-0.0.28\ No newline at end of file+0.0.29\ 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 (Chrome + Edge)",-  "version": "0.0.28",+  "version": "0.0.29",   "description": "Drives the user's REAL signed-in Chrome/Edge via an installed extension (native-messaging transport). Mirrors the puppeteer bridge's verb surface as nbrowser_* but runs inside the actual logged-in profile, so cookies/SSO/saved-logins/captcha human-trust all work. The bridge binds an ephemeral loopback port (PORTS.md compliant) and writes a discovery file; the native-messaging host pumps stdio <-> this bridge; the extension never touches a TCP port.",   "homepage": "https://wiki.adom.inc/adom/adom-browser-extension",   "author": "Adom Inc.",
bridge/package.json+1−1
@@ -1,6 +1,6 @@ {   "name": "adom-native-browser-bridge",-  "version": "0.0.28",+  "version": "0.0.29",   "private": true,   "description": "adom-desktop bridge for the Adom native-browser extension (Chrome + Edge)",   "main": "server.js",
bridge/server.js+21−17
@@ -504,25 +504,29 @@ async function _elevatedChromeWithNotify(installerPath) {     await _raiseElevatedChrome(installerPath);     return await pollChrome(150 * 1000);   }-  const OVERALL_MS = 12 * 60 * 1000; const t0 = Date.now(); let first = true;+  const doneToast = () => _notify({ id, level: 'success', title: 'Chrome is installed ✓', body: 'Google Chrome is ready. Next: sign into your Google account, then load the Adom extension (setting-up-native-chrome).' });+  // Fire ONE sticky "Approve now" toast, then poll QUIETLY for the tap (or chrome appearing) for the+  // whole window. Do NOT re-fire on a timer - that stacked toasts up and stormed the user. Re-notify+  // ONLY after an actual tap whose UAC didn't complete, so they can retry. scenario:reminder keeps the+  // single toast sticky. (Note: also no peer pings from here - we only ever notify the LOCAL desktop+  // where the UAC actually is, so we never spam the user's other machines.)+  const fireToast = (again) => _notify({ id, level: 'warning', scenario: 'reminder', buttons: [{ label: 'Approve now' }],+    title: again ? 'Chrome still needs approval' : 'Chrome needs your approval',+    body: `Tap 'Approve now', then click YES on the Windows security prompt to install Google Chrome on ${host}.` });+  await fireToast(false);+  const OVERALL_MS = 10 * 60 * 1000; const t0 = Date.now();   while (Date.now() - t0 < OVERALL_MS) {-    await _notify({ id, level: 'warning', scenario: 'reminder', buttons: [{ label: 'Approve now' }],-      title: first ? 'Chrome needs your approval' : 'Chrome still needs your approval',-      body: `Tap 'Approve now', then click YES on the Windows security prompt to finish installing Google Chrome on ${host}.` });-    first = false;-    let tapped = false; const waitEnd = Date.now() + 4 * 60 * 1000;-    while (Date.now() < waitEnd) {-      await _sleep(2500);-      const c = detectChrome();-      if (c) { await _notify({ id, level: 'success', title: 'Chrome is installed ✓', body: 'Google Chrome is ready. Next: sign into your Google account, then load the Adom extension.' }); return c; }-      const resp = await _notifyResp(id);-      const rb = resp && resp.body;-      if (rb && rb.pending === false && rb.action) { tapped = true; break; }+    await _sleep(2500);+    const c = detectChrome();+    if (c) { await doneToast(); return c; }+    const resp = await _notifyResp(id);+    const rb = resp && resp.body;+    if (rb && rb.pending === false && rb.action) {+      await _raiseElevatedChrome(installerPath);        // they tapped -> raise the UAC once+      const c2 = await pollChrome(130 * 1000);+      if (c2) { await doneToast(); return c2; }+      await fireToast(true);                             // UAC didn't complete -> ONE re-notify, keep polling     }-    if (!tapped) continue;-    await _raiseElevatedChrome(installerPath);-    const c = await pollChrome(130 * 1000);-    if (c) { await _notify({ id, level: 'success', title: 'Chrome is installed ✓', body: 'Google Chrome is ready. Next: sign into your Google account, then load the Adom extension.' }); return c; }   }   return null; }
native-browser-bridge-manifest.json+5−5
@@ -1,8 +1,8 @@ {   "manifest_version": 1,-  "version": "0.0.28",-  "url": "native-browser-bridge-v0.0.28.bin",-  "sha256": "5f09c7f678cb16e1af82b68ad437987d305a750d34dbb15e8209eeed22fbd62a",-  "size": 34071,-  "released_at": "2026-07-05T12:28:54Z"+  "version": "0.0.29",+  "url": "native-browser-bridge-v0.0.29.bin",+  "sha256": "2ae2e05ed1b53aea5e84739a68df4a3b6da18d36902a884afa4322d319cf783c",+  "size": 34309,+  "released_at": "2026-07-05T12:39:33Z" }\ No newline at end of file