Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/ServiceControl.Audit.Persistence/BodyStorageEnricher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ async ValueTask<bool> TryStoreBody(ReadOnlyMemory<byte> body, ProcessedMessage p
catch (DecoderFallbackException e)
{
useBodyStore = true;
logger.LogInformation("Body for {BodyId} could not be stored embedded, fallback to body storage ({ErrorMessage})", bodyId, e.Message);
contentType = "application/octet-stream";
processedMessage.MessageMetadata["ContentType"] = contentType;
logger.LogInformation("Body for {BodyId} is not valid UTF-8 despite content type header, storing as binary ({ErrorMessage})", bodyId, e.Message);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public Task RecordFailedProcessingAttempt(
}
catch (ArgumentException)
{
// If it won't decode to text, don't index it
contentType = "application/octet-stream";
processingAttempt.MessageMetadata["ContentType"] = contentType;
Comment on lines +56 to +57
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't feel right to do this at the RavenDB implementation.
We are about to add more persistences and it feels like this should be handled by the framework not the specific implementions

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnsimons if you look at this from the perspective of the bug fix and also that the content type handling is already in place it seems totally OK as a transitionary solution

}
}
}
Expand Down
Loading