From 97d87b5160b32079b97034466581c253bb6d919c Mon Sep 17 00:00:00 2001 From: Malte E <97891689+maltee1@users.noreply.github.com> Date: Fri, 28 Jun 2024 23:20:30 +0200 Subject: [PATCH] v1/portal: log more errors for addmember (#475) [skip ci] --- portal.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/portal.go b/portal.go index 0369c045..37fabe68 100644 --- a/portal.go +++ b/portal.go @@ -1018,12 +1018,15 @@ func (portal *Portal) applySignalGroupChange(ctx context.Context, source *User, } } } else { - puppet, _ = portal.sendMembershipForPuppetAndUser(ctx, sender, addMember.ACI, event.MembershipInvite, "added") + puppet, err = portal.sendMembershipForPuppetAndUser(ctx, sender, addMember.ACI, event.MembershipInvite, "added") } - if puppet != nil { - puppet.IntentFor(portal).SendCustomMembershipEvent(ctx, portal.MXID, puppet.IntentFor(portal).UserID, event.MembershipJoin, "") - } else { - log.Warn().Stringer("signal_user_id", addMember.ACI).Msg("Couldn't get puppet for invite") + if err != nil { + log.Err(err).Stringer("signal_user_id", addMember.ACI).Msg("Couldn't get puppet for invite") + return + } + _, err = puppet.IntentFor(portal).SendCustomMembershipEvent(ctx, portal.MXID, puppet.IntentFor(portal).UserID, event.MembershipJoin, "") + if err != nil { + log.Err(err).Stringer("mxid", puppet.MXID).Msg("Failed to join user") } } bannedMembers := make(map[uuid.UUID]bool)