fix(matrix): accept repeat invites before provisioning

This commit is contained in:
Mikhail Putilovskij 2026-04-08 02:18:11 +03:00
parent 37643a9695
commit 8efc91b02b
2 changed files with 4 additions and 2 deletions

View file

@ -20,12 +20,12 @@ async def handle_invite(client: Any, room: Any, event: Any, platform, store, aut
matrix_user_id = getattr(event, "sender", "")
display_name = getattr(room, "display_name", None) or matrix_user_id
await client.join(room.room_id)
existing = await get_user_meta(store, matrix_user_id)
if existing and existing.get("space_id"):
return
await client.join(room.room_id)
user = await platform.get_or_create_user(
external_id=matrix_user_id,
platform="matrix",

View file

@ -179,7 +179,9 @@ async def test_invite_event_is_idempotent_per_user():
runtime.chat_mgr,
)
assert client.join.await_count == 2
assert client.room_create.await_count == 2
client.room_send.assert_awaited_once()
async def test_bot_ignores_its_own_messages():