Skip to content

Commit

Permalink
Don't store partial send events
Browse files Browse the repository at this point in the history
  • Loading branch information
AchoArnold committed Dec 5, 2023
1 parent ce442d1 commit c9d5449
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/pkg/handlers/message_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package handlers

import (
"fmt"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -290,6 +291,10 @@ func (h *MessageHandler) PostEvent(c *fiber.Ctx) error {
}

request.MessageID = c.Params("messageID")
if strings.Contains(request.MessageID, ".") {
return h.responseNoContent(c, "message event stored successfully")
}

if errors := h.validator.ValidateMessageEvent(ctx, request.Sanitize()); len(errors) != 0 {
msg := fmt.Sprintf("validation errors [%s], while storing event [%s] for message [%s]", spew.Sdump(errors), c.Body(), request.MessageID)
ctxLogger.Warn(stacktrace.NewError(msg))
Expand Down

0 comments on commit c9d5449

Please sign in to comment.