aboutsummaryrefslogtreecommitdiff
path: root/roomserver
diff options
context:
space:
mode:
authorkegsay <kegan@matrix.org>2021-07-14 10:39:17 +0100
committerGitHub <noreply@github.com>2021-07-14 10:39:17 +0100
commite80098e18630df4ff148c16f741dd72f33e2b1c8 (patch)
treee0f400b03c431f829b762f0b6becd26253490f88 /roomserver
parent7df3e691f218c7af7337ca2729d1cbaf3586726f (diff)
bugfix: retire invites even when we cannot talk to the remote server to make/send_leave (#1918)
* bugfix: retire invites even when we cannot talk to the remote server to make/send_leave Also modify the leave response in /sync to include a fake event as this is ultimately what clients (and sytest) will use to determine leave-ness. * hash the event ID * Base64 not hex
Diffstat (limited to 'roomserver')
-rw-r--r--roomserver/internal/perform/perform_leave.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/roomserver/internal/perform/perform_leave.go b/roomserver/internal/perform/perform_leave.go
index 4d10dea6..88eb7e1e 100644
--- a/roomserver/internal/perform/perform_leave.go
+++ b/roomserver/internal/perform/perform_leave.go
@@ -26,6 +26,7 @@ import (
"github.com/matrix-org/dendrite/roomserver/storage"
"github.com/matrix-org/dendrite/setup/config"
"github.com/matrix-org/gomatrixserverlib"
+ "github.com/matrix-org/util"
)
type Leaver struct {
@@ -171,7 +172,9 @@ func (r *Leaver) performFederatedRejectInvite(
}
leaveRes := fsAPI.PerformLeaveResponse{}
if err := r.FSAPI.PerformLeave(ctx, &leaveReq, &leaveRes); err != nil {
- return nil, err
+ // failures in PerformLeave should NEVER stop us from telling other components like the
+ // sync API that the invite was withdrawn. Otherwise we can end up with stuck invites.
+ util.GetLogger(ctx).WithError(err).Errorf("failed to PerformLeave, still retiring invite event")
}
// Withdraw the invite, so that the sync API etc are