GODT-2223: Testing event processing scenarios.

This commit is contained in:
Jakub
2023-01-25 09:36:48 +01:00
parent 996c6826b9
commit 160489a771
5 changed files with 262 additions and 113 deletions

View File

@ -506,6 +506,7 @@ func (user *User) handleCreateMessageEvent(ctx context.Context, event proton.Mes
if err != nil {
// If the message is not found, it means that it has been deleted before we could fetch it.
if apiErr := new(proton.APIError); errors.As(err, &apiErr) && apiErr.Status == http.StatusUnprocessableEntity {
user.log.WithField("messageID", event.Message.ID).Warn("Cannot add new message: full message is missing on API")
return nil, nil
}
@ -602,6 +603,7 @@ func (user *User) handleUpdateDraftEvent(ctx context.Context, event proton.Messa
if err != nil {
// If the message is not found, it means that it has been deleted before we could fetch it.
if apiErr := new(proton.APIError); errors.As(err, &apiErr) && apiErr.Status == http.StatusUnprocessableEntity {
user.log.WithField("messageID", event.Message.ID).Warn("Cannot add new draft: full message is missing on API")
return nil, nil
}