From f39e25f9720a8ee75fc093df61376dbe46d8c39f Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 12 Feb 2023 18:52:42 -0800 Subject: [PATCH] modules/federation/invite: Re-enable auth fetch attempts for non-synapse invites. ircd::m::vm::fetch: Attempt auth with tolerated failures when opts.auth=false. --- matrix/vm_fetch.cc | 9 +++++++-- modules/federation/invite.cc | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/matrix/vm_fetch.cc b/matrix/vm_fetch.cc index e07b050cf..3114c6894 100644 --- a/matrix/vm_fetch.cc +++ b/matrix/vm_fetch.cc @@ -327,14 +327,19 @@ catch(const vm::error &e) } catch(const std::exception &e) { - log::error + log::logf { - log, "Fetching auth chain for %s in %s :%s", + log, eval.opts->auth? log::ERROR: log::DERROR, + "Fetching auth chain for %s in %s :%s", string_view{room.event_id}, string_view{room.room_id}, e.what(), }; + // Stop propagation if auth not required but fetch attempted anyway + if(!eval.opts->auth) + return; + throw; } diff --git a/modules/federation/invite.cc b/modules/federation/invite.cc index f6159ce80..6f0b4ad02 100644 --- a/modules/federation/invite.cc +++ b/modules/federation/invite.cc @@ -423,7 +423,7 @@ try vmopts.node_id = request.node_id; // Synapse may 403 a fetch of the prev_event of the invite event. - vmopts.fetch = false; + vmopts.phase.set(m::vm::phase::FETCH_PREV, false); // Synapse now 403's a fetch of auth_events of the invite event vmopts.auth = false;