From e20ff352b91623d51ae05ea586a1800aee852402 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Sun, 28 Jun 2026 19:29:24 -0700 Subject: [PATCH] test(matrix): authorize inviter in DM-invite fixture for new invite-auth gate _on_invite now rejects auto-joins from users not on the allow-list. The DM-recording tests invite @alice and expect a join, so the shared _make_adapter fixture now puts @alice on _allowed_user_ids. --- tests/gateway/test_matrix_dm_invite_recording.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/gateway/test_matrix_dm_invite_recording.py b/tests/gateway/test_matrix_dm_invite_recording.py index 77d9ae56bf1..48709a6c2e4 100644 --- a/tests/gateway/test_matrix_dm_invite_recording.py +++ b/tests/gateway/test_matrix_dm_invite_recording.py @@ -31,6 +31,10 @@ def _make_adapter(tmp_path=None): adapter._text_batch_delay_seconds = 0 adapter.handle_message = AsyncMock() adapter._startup_ts = time.time() - 10 + # Authorize the inviter used throughout this module so the invite-auth + # gate in _on_invite (rejects auto-joins from non-allow-listed users) + # lets the join through and the DM-recording side effects are exercised. + adapter._allowed_user_ids = {"@alice:example.org"} return adapter