From 040b53305cfd33beb9da5efa7ac58b18010755a6 Mon Sep 17 00:00:00 2001 From: Fabi <38692350+fgerschwiler@users.noreply.github.com> Date: Mon, 18 Oct 2021 10:41:39 +0200 Subject: [PATCH] fix: mapping (#2522) * fix: mapping * add logs Co-authored-by: adlerhurst --- internal/eventstore/handler/handler_projection.go | 2 ++ internal/query/projection/project_grant.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/eventstore/handler/handler_projection.go b/internal/eventstore/handler/handler_projection.go index f21af035f0..f8da244205 100644 --- a/internal/eventstore/handler/handler_projection.go +++ b/internal/eventstore/handler/handler_projection.go @@ -120,6 +120,7 @@ func (h *ProjectionHandler) Process( return case event := <-h.Handler.EventQueue: if err := h.processEvent(ctx, event, reduce); err != nil { + logging.LogWithFields("HANDL-TUk5J", "projection", h.ProjectionName).WithError(err).Warn("process failed") continue } h.triggerShouldPush(0) @@ -137,6 +138,7 @@ func (h *ProjectionHandler) Process( return case event := <-h.Handler.EventQueue: if err := h.processEvent(ctx, event, reduce); err != nil { + logging.LogWithFields("HANDL-horKq", "projection", h.ProjectionName).WithError(err).Warn("process failed") continue } h.triggerShouldPush(0) diff --git a/internal/query/projection/project_grant.go b/internal/query/projection/project_grant.go index 0e89834b70..f2836e1b79 100644 --- a/internal/query/projection/project_grant.go +++ b/internal/query/projection/project_grant.go @@ -122,7 +122,7 @@ func (p *ProjectGrantProjection) reduceProjectGrantChanged(event eventstore.Even } func (p *ProjectGrantProjection) reduceProjectGrantCascadeChanged(event eventstore.EventReader) (*handler.Statement, error) { - e, ok := event.(*project.GrantChangedEvent) + e, ok := event.(*project.GrantCascadeChangedEvent) if !ok { logging.LogWithFields("HANDL-K0fwR", "seq", event.Sequence(), "expectedType", project.GrantCascadeChangedType).Error("was not an event") return nil, errors.ThrowInvalidArgument(nil, "HANDL-ll9Ts", "reduce.wrong.event.type")