aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-11-12 23:35:08 -0700
committerAdam Soltys <[email protected]>2026-11-12 23:35:08 -0700
commit8d92028c0a4eeb19258e81156c5b9efc3c1d1f88 (patch)
treeadca345fe4d97e851c4b61c7a6dc0d1c96aa95d1 /tools
parent5dad3fed20be40eaaeb8e7373dd005f61b3e5c8b (diff)
downloadcoinosv3-8d92028c0a4eeb19258e81156c5b9efc3c1d1f88.tar.gz
coinosv3-8d92028c0a4eeb19258e81156c5b9efc3c1d1f88.zip
Leaving a group from its own screen no longer breaks the app. "Tried to leave but got this" (Adam, 2026-11-13): ReferenceError "Cannot access 'Q' before initialization" in the group screen. wnView declares `const wn = gClient(g)` for the group on screen, which shadows the module's wn for the whole function; the "groups still loading" test above it (`!wn || … || !ng || ngLoading`, widened for relay groups in 3197c70) ran when the group was gone — just left — and read the inner wn before it was set. The test now lives outside the function (groupClientsLoading). nip29-group-test leaves the dead-relay group from its own screen on the second device: "Something broke" without this, back to Messages with itHEADmaster
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6UKGJyuGyZFxddYRxS
Diffstat (limited to 'tools')
-rw-r--r--tools/nip29-group-test.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/nip29-group-test.js b/tools/nip29-group-test.js
index de9b8e1..ddc7258 100644
--- a/tools/nip29-group-test.js
+++ b/tools/nip29-group-test.js
@@ -131,6 +131,13 @@ try {
let dead = '';
for (let i = 0; i < 60 && !/answering/.test(dead); i++) { dead = await p2.evaluate(() => [...document.querySelectorAll('.chat-thread-row')].find((r) => r.textContent.includes('deadgroup'))?.textContent || ''); if (!/answering/.test(dead)) await sleep(250); }
check("a group on a relay that's gone says so", /gone\.invalid isn't answering/.test(dead), dead.slice(0, 80));
+ // leaving it from its own screen ("Tried to leave but got this": a
+ // ReferenceError on the screen of a group that had just gone)
+ await p2.evaluate(() => [...document.querySelectorAll('.chat-thread-row')].find((r) => r.textContent.includes('deadgroup'))?.click()); await sleep(800);
+ await p2.click('[aria-label="Leave group"]'); await sleep(200);
+ await p2.click('[aria-label="Leave group"]'); await sleep(2500);
+ const after = await p2.evaluate(() => document.body.innerText);
+ check('leaving a group from its screen goes back to Messages', !/something broke/i.test(after) && !/deadgroup/.test(after) && /new group/i.test(after), after.slice(0, 120));
await ctx.close();
}