From c270344b1a4d1e6791de86ff29bbf3fd0abb19dc Mon Sep 17 00:00:00 2001 From: anatoleam Date: Wed, 13 Dec 2023 14:38:19 +0100 Subject: [PATCH] fix: presences fanout fail on deleted set --- internal/svc/presences/presences.fanout.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/svc/presences/presences.fanout.go b/internal/svc/presences/presences.fanout.go index 88cd6620..2bfe266e 100644 --- a/internal/svc/presences/presences.fanout.go +++ b/internal/svc/presences/presences.fanout.go @@ -167,12 +167,13 @@ func (p *inst) ChannelPresenceFanout(ctx context.Context, opt ChannelPresenceFan } // Fetch Emote Sets - sets, errs := p.loaders.EmoteSetByID().LoadAll(setIDs) - if multierror.Append(nil, errs...).ErrorOrNil() != nil { - return err - } + sets, _ := p.loaders.EmoteSetByID().LoadAll(setIDs) for _, es := range sets { + if es.ID.IsZero() { + continue + } + es.Owner = nil ent, ok := entMap[es.ID] @@ -186,7 +187,7 @@ func (p *inst) ChannelPresenceFanout(ctx context.Context, opt ChannelPresenceFan return x.ID }), ) - if multierror.Append(nil, errs...).ErrorOrNil() != nil { + if err = multierror.Append(nil, errs...).ErrorOrNil(); err != nil { zap.S().Errorw("failed to load emotes", "emote_set_id", es.ID, "errors", errs) continue