From 29987061cba2f4003278a965873e82afdf4bf026 Mon Sep 17 00:00:00 2001 From: Keysat Date: Thu, 18 Jun 2026 10:33:19 -0500 Subject: [PATCH] matrix-intake: bot joins the email-review room on startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit room_send to a room the bot is only invited to (not joined) fails M_FORBIDDEN; join explicitly on startup (idempotent if already a member). Bot-only change — ships via the Spark git pull, no s9pk bump. --- backend/matrix_intake/bot.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/matrix_intake/bot.py b/backend/matrix_intake/bot.py index bd07918..483fa8e 100644 --- a/backend/matrix_intake/bot.py +++ b/backend/matrix_intake/bot.py @@ -275,6 +275,12 @@ async def main(): print(f"matrix-intake: listening as {who.user_id} in room {intake_room}", flush=True) tasks = [asyncio.create_task(client.sync_forever(timeout=30000))] if review_room: + # "Invited" isn't "joined" — the bot must join before it can post cards (room_send to a + # room we're only invited to fails M_FORBIDDEN). Idempotent if already a member. + try: + await client.join(review_room) + except Exception as exc: + print(f"matrix-intake: could not join review room {review_room}: {exc}", flush=True) tasks.append(asyncio.create_task(poll_email_proposals())) print(f"matrix-intake: reviewing email proposals in room {review_room} (every {EMAIL_POLL_SEC}s)", flush=True) try: