diff options
| author | Adam Soltys <[email protected]> | 2026-10-18 09:48:13 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-18 09:48:13 -0700 |
| commit | 5869fa2ce351efa485ae6547d618a216b09a47c1 (patch) | |
| tree | 6894739087f320bd48c18c58fd5ca6fe8d8d6781 /tools/call-wake-test.js | |
| parent | aaebbd5d51e0e149c36975122dd0ae59e6c011bb (diff) | |
| download | coinosv3-5869fa2ce351efa485ae6547d618a216b09a47c1.tar.gz coinosv3-5869fa2ce351efa485ae6547d618a216b09a47c1.zip | |
A call from someone you don't follow and haven't written to no longer vanishes: it doesn't ring, but it's a missed call in your conversation with them, saying it didn't ring and why, a tap away from calling back (with the app shut, the worker notes it for the app, without a notification). A muted person's still leaves nothing. A logged call no longer counts as having written to someone.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013ZDf1cyCQLkfjftYhymZAg
Diffstat (limited to 'tools/call-wake-test.js')
| -rw-r--r-- | tools/call-wake-test.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/call-wake-test.js b/tools/call-wake-test.js index e14935a..54c42ee 100644 --- a/tools/call-wake-test.js +++ b/tools/call-wake-test.js @@ -26,10 +26,11 @@ console.log('[the worker\'s check]'); const box = [{ pubkey: B, sk: bytesToHex(bob), follows: [Al], known: [], muted: [], names: { [Al]: 'Alice' } }]; const offer = (sk, ago = 0, kind = CALL.OFFER, to = B) => wrapCall(finalizeEvent({ ...callEvent(kind, to, 'id-1', 'v=0', kind === CALL.OFFER ? [['call-type', 'video']] : []), created_at: Math.floor(Date.now() / 1000) - ago }, sk), to); const r = await classifyCall(offer(alice), box); - check('a fresh offer from someone followed rings, named, video', !!r && r.name === 'Alice' && r.type === 'video' && r.offer.pubkey === Al); - check('...a stranger\'s doesn\'t', (await classifyCall(offer(eve), box)) === null); + check('a fresh offer from someone followed rings, named, video', !!r && !r.quiet && r.name === 'Alice' && r.type === 'video' && r.offer.pubkey === Al); + check('...a stranger\'s doesn\'t ring, but is kept as quiet', (await classifyCall(offer(eve), box))?.quiet === true); check('...nor someone muted', (await classifyCall(offer(alice), [{ ...box[0], muted: [Al] }])) === null); - check('...but someone written to does', !!(await classifyCall(offer(eve), [{ ...box[0], known: [E] }]))); + check('...but someone written to rings', (await classifyCall(offer(eve), [{ ...box[0], rings: [E] }]))?.quiet === false); + check('...not someone who only wrote to us', (await classifyCall(offer(eve), [{ ...box[0], known: [E], rings: [] }]))?.quiet === true); check('...an offer over a minute old doesn\'t', (await classifyCall(offer(alice, 90), box)) === null); check('...nor a candidate or a hang-up', (await classifyCall(offer(alice, 0, CALL.ICE), box)) === null && (await classifyCall(offer(alice, 0, CALL.HANGUP), box)) === null); check('...nor a wrap for someone else', (await classifyCall(offer(alice, 0, CALL.OFFER, E), box)) === null); @@ -176,6 +177,10 @@ try { await B.page.goto(`http://localhost:${PORT}/`, { waitUntil: 'domcontentloaded' }); await B.waitText('receive'); check('a stranger\'s offer, or one gone, rings nothing', !(await notifications(B.page)).some((n) => /calling/.test(n)) && !(await B.page.evaluate(() => !!document.querySelector('.call-overlay')))); + await B.page.goto(`http://localhost:${PORT}/` + npubEncode(getPublicKey(eve)), { waitUntil: 'domcontentloaded' }); + await B.page.waitForSelector('.prof-actions', { timeout: 20000 }); + await B.page.evaluate(() => [...document.querySelectorAll('.prof-actions button')].find((x) => /message/i.test(x.textContent)).click()); + check('...but the stranger\'s call is in the app once it opens: missed, didn\'t ring', await waitFor(B.page, () => [...document.querySelectorAll('.chat-row.call-log.missed')].some((r) => /didn.t ring/i.test(r.innerText)), 10000)); console.log('\n[rung while closed, and nobody came]'); await B.page.goto('about:blank'); |
