From d5c0e6063340746a4c49ae6c81a125d86bcde893 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 13 Jan 2023 18:16:06 -0800 Subject: [PATCH] modules/federation/invite: Workaround matrix-org/synapse@c06b2b7142 matrix-org/synapse#13823 --- modules/client/sync/rooms.cc | 8 +++++++- modules/federation/invite.cc | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/client/sync/rooms.cc b/modules/client/sync/rooms.cc index b6f5a1541..690c6d364 100644 --- a/modules/client/sync/rooms.cc +++ b/modules/client/sync/rooms.cc @@ -82,9 +82,15 @@ ircd::m::sync::rooms_linear(data &data) && membership == "join" }; + const bool is_own_positive + { + is_own_membership + && (membership == "join" || membership == "invite") + }; + //assert(!is_own_join || m::membership(*data.event) == "join"); assert(!is_own_join || !!m::membership(membuf, room, data.user)); - assert(is_own_join || !json::get<"room_id"_>(*data.event) || m::exists(room)); + assert(is_own_positive || !json::get<"room_id"_>(*data.event) || m::exists(room)); if(should_ignore(data)) return false; diff --git a/modules/federation/invite.cc b/modules/federation/invite.cc index 8b8531c22..f6159ce80 100644 --- a/modules/federation/invite.cc +++ b/modules/federation/invite.cc @@ -423,7 +423,10 @@ try vmopts.node_id = request.node_id; // Synapse may 403 a fetch of the prev_event of the invite event. - vmopts.phase.set(m::vm::phase::FETCH_PREV, false); + vmopts.fetch = false; + + // Synapse now 403's a fetch of auth_events of the invite event + vmopts.auth = false; // Don't throw an exception for a re-evaluation; this will just be a no-op vmopts.nothrows |= m::vm::fault::EXISTS;