diff --git a/pushserver/producers/syncapi.go b/pushserver/producers/syncapi.go index 805964835..7b7e5c6b9 100644 --- a/pushserver/producers/syncapi.go +++ b/pushserver/producers/syncapi.go @@ -41,12 +41,11 @@ func (p *SyncAPI) SendAccountData(userID string, roomID string, dataType string) } m.Header.Set(jetstream.UserID, userID) - data := eventutil.AccountData{ + var err error + m.Data, err = json.Marshal(eventutil.AccountData{ RoomID: roomID, Type: dataType, - } - var err error - m.Data, err = json.Marshal(data) + }) if err != nil { return err } diff --git a/syncapi/consumers/pushserver.go b/syncapi/consumers/pushserver.go index 38be7f0d1..76da03274 100644 --- a/syncapi/consumers/pushserver.go +++ b/syncapi/consumers/pushserver.go @@ -93,7 +93,8 @@ func (s *OutputNotificationDataConsumer) onMessage(ctx context.Context, msg *nat log.WithFields(log.Fields{ "user_id": userID, "room_id": data.RoomID, - }).WithError(err).Panic("Could not save notification counts") + }).WithError(err).Error("Could not save notification counts") + return false } s.stream.Advance(streamPos)