CI / Build & Quality Checks (pull_request) Successful in 1m39s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 7s
CI / Playwright smoke (e2e) (pull_request) Successful in 10m48s
Joining a voice channel alone sends a call notification (m.rtc.notification) to the room, and the timeline rendered every unanswered one as "Missed call from X", so everyone in the channel saw a missed call from someone who had just joined it. Ringing already excluded these rooms; the missed-call line didn't. utils/callRing.ts (unit-tested) holds the one rule for both: only DMs and invite-only groups outside any space ring or show "Missed call"; voice rooms, space channels, restricted and public rooms don't. Verified headless with the same two notifications from Bob: the Voice Lounge chat showed 2 "Missed call" lines before, 0 after; a small invite-only group still shows its missed call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
30 lines
1.3 KiB
TypeScript
30 lines
1.3 KiB
TypeScript
import { test } from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import type { Room } from 'matrix-js-sdk';
|
|
import { isRingableRoom } from './callRing';
|
|
|
|
const fakeRoom = (opts: { callRoom?: boolean; joinRule?: string; spaceParent?: boolean }): Room =>
|
|
({
|
|
isCallRoom: () => !!opts.callRoom,
|
|
getJoinRule: () => opts.joinRule ?? 'invite',
|
|
getLiveTimeline: () => ({
|
|
getState: () => ({ getStateEvents: () => (opts.spaceParent ? [{}] : []) }),
|
|
}),
|
|
}) as unknown as Room;
|
|
|
|
test('voice rooms never ring or show "missed call", even as DMs', () => {
|
|
assert.equal(isRingableRoom(fakeRoom({ callRoom: true }), false), false);
|
|
assert.equal(isRingableRoom(fakeRoom({ callRoom: true }), true), false);
|
|
});
|
|
|
|
test('DMs and invite-only groups outside a space ring', () => {
|
|
assert.equal(isRingableRoom(fakeRoom({ joinRule: 'public' }), true), true);
|
|
assert.equal(isRingableRoom(fakeRoom({ joinRule: 'invite' }), false), true);
|
|
});
|
|
|
|
test('space channels, public and restricted rooms do not ring', () => {
|
|
assert.equal(isRingableRoom(fakeRoom({ joinRule: 'invite', spaceParent: true }), false), false);
|
|
assert.equal(isRingableRoom(fakeRoom({ joinRule: 'public' }), false), false);
|
|
assert.equal(isRingableRoom(fakeRoom({ joinRule: 'restricted' }), false), false);
|
|
});
|