Don't fail if we can't fetch the membership, default to 'leave' instead

This commit is contained in:
Till Faelligen 2022-10-10 09:18:42 +02:00
parent 6a47c2f11b
commit ab7deefdc4
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E

View file

@ -19,11 +19,13 @@ import (
"math"
"time"
"github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/dendrite/syncapi/storage"
"github.com/matrix-org/gomatrixserverlib"
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"
"github.com/tidwall/gjson"
"github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/dendrite/syncapi/storage"
)
func init() {
@ -189,7 +191,7 @@ func visibilityForEvents(
UserID: userID,
}, membershipResp)
if err != nil {
return result, err
logrus.WithError(err).Error("visibilityForEvents: failed to fetch membership at event, defaulting to 'leave'")
}
// Create a map from eventID -> eventVisibility