← Commit history

v2.0.250: Taskbar identity survives a bridge restart intact: the registry prune now seeds its live set from the sessions persisted on disk, by the identity each window was wearing and by the thread name it belongs to, so reloaded windows are no longer treated as orphans and stripped before their first stamp lands, and a thread whose tile art was not ready when it was registered retries on a bounded backoff instead of waiting for unrelated churn to brand it.

John Lauer ·dd8da30b73 ·2mo ago ·parent 54ec04a
4 files changed +46−9
adom-bridge-puppeteer-manifest.json+5−5
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "2.0.249",-  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.249/adom-bridge-puppeteer-v2.0.249.zip",-  "sha256": "aec64339838517634279314287c8329deafa6d967dea2b19d209a903f6aa4bbd",-  "size": 947442,+  "version": "2.0.250",+  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.250/adom-bridge-puppeteer-v2.0.250.zip",+  "sha256": "ef89c72355a1eef88ec11d27787f0e59bc1121765db45204d95c8fba82dfbc60",+  "size": 948180,   "verbPrefixes": [     "browser_",     "desktop_recorder_",@@ -12,5 +12,5 @@   ],   "healthEndpoint": "/status",   "statusVerb": "browser_readiness",-  "released_at": "2026-08-19T19:12:18.976000Z"+  "released_at": "2026-08-19T19:28:16.909737Z" }
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-2.0.249\ No newline at end of file+2.0.250\ No newline at end of file
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "2.0.249",+  "version": "2.0.250",   "description": "Drives a browser ALREADY on the machine \u2014 installed Chrome, else Microsoft Edge (every Windows PC ships with Edge) \u2014 launched with a FRESH isolated profile, so the common case has NO ~150 MB Chrome-for-Testing download and it never touches the user's real tabs/logins. Binds its local server to LOOPBACK (127.0.0.1) only, so no Windows Firewall 'allow Node through the firewall' prompt ever pops. Chrome for Testing is fetched only as a LAST RESORT if the machine has no Chromium browser at all. SPAWN-VERIFIED fallback: pup tries each detected browser (Chrome \u2192 Edge \u2192 CfT) and actually launches it, falling through to the next if one won't start (and handling browsers like Edge that relaunch onto another PID), so a corrupt/partial install never hard-fails an open. The browser that launches is cached as the default (persisted across restarts) so it isn't re-probed each time. On spawn the bridge SELF-WARMS: detects browsers + disk, and only if the box has no Chrome/Edge and no cached CfT does it background-fetch CfT so the first open is instant. pup_use pins a specific browser (chrome | edge | cft | auto); {browser:'chrome',install:true} downloads & installs REAL Google Chrome (user-scoped, no admin) on an Edge-only box. pup_readiness (READ-ONLY) reports which browser will be used + the full candidate list + the default + free disk. Every failure returns a specific errorCode + _hint (chrome_install_no_disk, chrome_download_network, chrome_install_permission, chrome_stable_not_detected, \u2026). Launches with FULL browser permissions by default for full debug (strictPermissions:true opts out). Headful automation: open/close windows+tabs, navigate, screenshot, eval JS, record. pup is a GENERIC, non-profile browser only \u2014 every session is a fresh isolated Chrome/Edge process, never the user's real signed-in browser; profile defaults to sessionId. To drive the user's REAL Chrome/Edge (their profile, cookies, SSO), use the Adom browser EXTENSION's nbrowser_* verbs \u2014 a separate bridge, not pup's job. macOS (v1.9.74+): full parity with mac-native mechanics \u2014 background-by-default is the app-level hide (windows stay drivable/screenshottable while hidden), raise/lower map to unhide+activate/hide, pup_alert_window posts a native toast whose click focuses the window, pup_use {browser:'chrome',install:true} installs Chrome from the official dmg, and taskbar identity/badging remains Windows-only.",   "homepage": "https://wiki.adom.inc/adom/adom-bridge",   "author": "Adom Inc.",
src/server.js+39−2
@@ -1429,6 +1429,10 @@ function saveSessionFile(sessionId, profileName, url) {     // and pup_list_windows reported owner:null for every session — silently disabling the     // session_owned_by_another_thread protection that owner is supposed to back.     owner: ((sessions.get(sessionId) || {}).owner) || null,+    // v2.0.250 (#51): persist the identity this window is WEARING. After a respawn a reloaded+    // session has _curAppId=null until its first stamp lands, so the boot prune could not tell a+    // live thread key from an orphan and deleted it, un-branding the button until a full re-stamp.+    appId: ((sessions.get(sessionId) || {})._curAppId) || null,     // v1.9.300: persist the resolved OS window handle. Chrome windows survive a bridge respawn with     // the SAME hwnd, so restoring + validating this on recovery lets a window keep its handle WITHOUT     // re-running the fragile width-wiggle — which is what stormed/deadlocked after every ship and left@@ -4200,7 +4204,22 @@ async function registerPupAumid(appId, sessionId) {         // v2.0.176: never brand a thread AUMID with the GENERIC pup icon (see stampPupIdentity) —         // that placeholder is exactly the first of the two icon applies John flagged. No tile yet =         // register nothing; the stamp defers too, and both land once when the art is ready.-        if (!tile) { console.log(`[thread-tile] register DEFERRED for "${threadName}" — tile not ready`); return; }+        if (!tile) {+          // v2.0.250 (#51 second half): a defer used to be terminal — the window stayed unbranded+          // until unrelated churn or a manual taskbarMode flip forced a fresh sweep (John measured+          // "many minutes"). Re-attempt on a bounded backoff so the tile lands on its own.+          const _k = `tile:${threadName}`;+          const _n = (_tileDeferRetries.get(_k) || 0) + 1;+          if (_n <= 5) {+            _tileDeferRetries.set(_k, _n);+            const _wait = Math.min(60000, 4000 * _n);+            console.log(`[thread-tile] register DEFERRED for "${threadName}" — tile not ready; retry ${_n}/5 in ${Math.round(_wait / 1000)}s`);+            setTimeout(() => { brandSweep(`tile-defer retry ${_n} for "${threadName}"`).catch(() => {}); }, _wait);+          } else {+            console.log(`[thread-tile] register DEFERRED for "${threadName}" — tile STILL not ready after 5 retries; leaving it to the next sweep`);+          }+          return;+        }         iconPath = tile;         displayName = String(threadName);   // the taskbar hover/label reads the thread name too       } else if (threadName) { return; }   // thread window, no page to draw with yet — wait, don't placeholder@@ -4336,6 +4355,7 @@ function cachedIconPng(file, decode) {     return out;   } catch (e) { return null; } }+const _tileDeferRetries = new Map();   // v2.0.250 (#51): bounded retries per thread whose tile render deferred const _parkNoHwndLogged = new Set();   // v2.0.237: log the no-handle park once per session const _threadTileInflight = new Map();   // name -> Promise (dedupe concurrent renders) // Render (or return cached) the .ico path for a thread name. v2.0.158: draw the tile on an OFFSCREEN@@ -4346,7 +4366,12 @@ const _threadTileInflight = new Map();   // name -> Promise (dedupe concurrent r // non-destructive). Returns a data-URL PNG that the bridge converts to a multi-size .ico. async function renderThreadTileIco(page, name) {   const icoPath = path.join(THREAD_TILE_DIR, `${threadSlug(name)}.ico`);-  try { if (fs.existsSync(icoPath) && fs.statSync(icoPath).size > 100) return icoPath; } catch (e) {}+  try {+    if (fs.existsSync(icoPath) && fs.statSync(icoPath).size > 100) {+      try { _tileDeferRetries.delete(`tile:${name}`); } catch (e) {}   // v2.0.250: art exists, stop retrying+      return icoPath;+    }+  } catch (e) {}   // v2.0.228: a FIRST render means every button of this thread was built before its art existed   // (Windows bakes a button's icon at creation) — audit shortly after so those get rebuilt. This is   // the exact defect John's audit found on "ah build thread".@@ -4452,6 +4477,18 @@ function pruneStaleAumids() {   }   for (const id of _earlyStamped.values()) { if (id) liveAppIds.add(id); }   for (const id of _registeredPupAumids) { if (id) liveAppIds.add(id); }+  // v2.0.250 (#51): seed from what is ON DISK too. A window that existed before this boot is still+  // on the user's taskbar wearing its identity, so its key is live even though no in-memory session+  // has stamped yet. Two sources: the appId persisted at save time, and the thread AUMID the+  // session's owner implies (same formula the stamp uses), which covers files written before this+  // field existed.+  try {+    for (const sf of listSessionFiles()) {+      if (sf && sf.appId) liveAppIds.add(sf.appId);+      const _own = sf && sf.owner;+      if (_own) liveAppIds.add(`${PUP_APP_ID}.thread.${threadSlug(_own)}.${THREAD_TILE_GEN}`);+    }+  } catch (e) {}   try {     const out = execFileSync('reg', ['query', 'HKCU\\Software\\Classes\\AppUserModelId'],       { encoding: 'utf8', timeout: 8000, windowsHide: true });