From f9d6472f77baca1b23fbd8dc471d935ef5a152dd Mon Sep 17 00:00:00 2001 From: sravan Date: Sat, 18 Jul 2026 13:18:58 +0530 Subject: [PATCH] chore(mobile): add /api/dbg diagnostics sink + client reporter (build, overflow, viewport, scroll) Temporary: the app POSTs its real runtime state to the server log so device-only bugs (budge source, keyboard viewport numbers, chat-open scroll state) can be diagnosed from docker logs instead of screenshots. Removed once mobile issues settle. Build marker -> 2026-07-18-batch108. Co-Authored-By: Claude Opus 4.8 --- server/public/home.html | 30 +++++++++++++++++++++++++++++- server/routes.js | 7 +++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/server/public/home.html b/server/public/home.html index 13efa92..11f1610 100644 --- a/server/public/home.html +++ b/server/public/home.html @@ -1112,7 +1112,7 @@ - } }catch(_){} })(); +
Biz Connect
Loading…
@@ -2824,6 +2851,7 @@ async function openConvo(kind,id){ // late content (avatars, images, day separators) settles, unless we deliberately stopped at a "New // messages" divider. This is the safety net over renderThread()'s own pin. [0,120,320,600].forEach((d)=>setTimeout(()=>{ if(selected&&selected.kind===kind&&selected.id===id){ const b=document.getElementById('msgs'); if(b && !b.querySelector('.new-sep')) b.scrollTop=b.scrollHeight; } }, d)); + setTimeout(()=>{ try{ const b=document.getElementById('msgs'); if(b && window.bzDbg) bzDbg('convoOpen',{count:THREAD.length, scrollTop:Math.round(b.scrollTop), scrollH:Math.round(b.scrollHeight), clientH:Math.round(b.clientHeight), atBottom:(b.scrollHeight-b.scrollTop-b.clientHeight)<8, newsep:!!b.querySelector('.new-sep'), vis:b.style.visibility||'visible'}); }catch(_){} }, 700); } // ---------- @mentions (group chat) ---------- let mentionItems=[], mentionIdx=0, mentionStart=-1; diff --git a/server/routes.js b/server/routes.js index bf933de..2eb4ce3 100644 --- a/server/routes.js +++ b/server/routes.js @@ -1004,6 +1004,13 @@ try { } catch (_) {} route('GET', '/api/build', (req, res) => json(res, 200, { build: APP_BUILD })); +// TEMP mobile debug sink: the app POSTs its real runtime state here so we can diagnose device-only issues +// from the server log (docker logs bizgaze-support) without screenshots. Remove once mobile bugs settle. +route('POST', '/api/dbg', async (req, res) => { + try { const b = await readBody(req); console.log('[MDBG]', JSON.stringify(b)); } catch (_) {} + json(res, 200, { ok: true }); +}); + // Mint a LiveKit join token for the signed-in user + a specific room (the 6-digit meeting code). // The room-membership/host authorization already happens over the meeting WebSocket; this only // hands the client a media-plane credential scoped to that room and its own identity.