Skip to content

Commit d7aad0e

Browse files
committed
bridgev2/portal: update context for remote deletes too
1 parent 49a05bf commit d7aad0e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

bridgev2/portal.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3938,7 +3938,9 @@ func (portal *Portal) handleRemoteChatDelete(ctx context.Context, source *UserLo
39383938
log.Err(err).Msg("Failed to delete portal from database")
39393939
return EventHandlingResultFailed.WithError(err)
39403940
}
3941-
err = portal.Bridge.Bot.DeleteRoom(ctx, portal.MXID, false)
3941+
// The event context has likely been canceled by delete, so use a background context for the delete call
3942+
noCancelCtx := log.WithContext(portal.Bridge.BackgroundCtx)
3943+
err = portal.Bridge.Bot.DeleteRoom(noCancelCtx, portal.MXID, false)
39423944
if err != nil {
39433945
log.Err(err).Msg("Failed to delete Matrix room")
39443946
return EventHandlingResultFailed.WithError(err)

0 commit comments

Comments
 (0)