From 97567d15ddd606ac7bd8fbd23a3f52e018a5c362 Mon Sep 17 00:00:00 2001 From: rouggy Date: Sun, 30 Aug 2026 02:51:05 +0200 Subject: [PATCH] debug(dvk): trace the auto-CQ loop into the app log It keeps 'not repeating' on a network rig and every guess at which guard was tripping proved wrong. Each round now logs play / playing-flag / end / gap, and every exit names its reason. --- frontend/src/App.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 8667f50..7fed4fa 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1746,19 +1746,29 @@ export default function App() { const gen = ++dvkAutoCqGenRef.current; dvkAutoCqSlotRef.current = slot; const sleep = (ms: number) => new Promise((r) => window.setTimeout(r, ms)); + // Traced into the app log deliberately: the loop kept 'not repeating' on a + // network rig and every guess at which guard was tripping proved wrong. + const trace = (m: string) => UILog().catch(() => {}); + trace(); + let round = 0; while (dvkAutoCqSlotRef.current === slot && gen === dvkAutoCqGenRef.current && dvkActiveRef.current) { // An EMPTY mode is not a mode change: over the network the rig's mode // read fails transiently and the CAT push blanks the field for a poll or // two — killing the auto-CQ loop mid-run for nothing. Only a known // non-phone mode stops the loop. - if (modeRef.current && !isPhoneMode(modeRef.current)) { stopDvkAutoCq(); break; } - await DVKPlay(slot).catch(() => {}); + if (modeRef.current && !isPhoneMode(modeRef.current)) { trace(); stopDvkAutoCq(); break; } + round++; + trace(); + await DVKPlay(slot).catch((e: any) => trace()); await sleep(300); // let playback flip "playing" true + trace(); let guard = 0; // then wait for it to finish (cap ~90 s) while (dvkPlayingRef.current && gen === dvkAutoCqGenRef.current && guard < 600) { await sleep(150); guard++; } - if (gen !== dvkAutoCqGenRef.current) break; + if (gen !== dvkAutoCqGenRef.current) { trace(); break; } + trace(); await sleep(Math.max(0, dvkAutoCqSecsRef.current) * 1000); // gap before the next CQ } + trace(); } const dvkPlay = useCallback((slot: number) => { if (!isPhoneMode(modeRef.current)) { setError(t('dvkp.notPhone')); return; }