Add deterministic ids to failed message imports - #5919
Merged
Merged
Conversation
rbev
added this pull request to stack #5920
September 24, 2026 06:42
johnsimons
reviewed
Sep 24, 2026
| public async Task SaveFailedAuditImport(FailedAuditImport message, CancellationToken cancellationToken = default) | ||
| { | ||
| using var session = await sessionProvider.OpenSession(cancellationToken: cancellationToken); | ||
| if (message.Id != null && !message.Id.StartsWith("FailedAuditImports/", StringComparison.OrdinalIgnoreCase)) |
Member
There was a problem hiding this comment.
This is strange. Why would an ID ever include the "FailedAuditImports/" prefix at all when it reaches this method?
Contributor
Author
There was a problem hiding this comment.
The code is replicating what we were doing in error, where there are places that records get roundtripped.
In this case I'm pretty sure it's always unset on the way in.
I did wonder whether it would be better to either:
- Verify that and enforce it being unset on save; or
- Check if the "id" is even used outside of raven and remove it from the contract (I think we did this in at least one place)
Contributor
Author
There was a problem hiding this comment.
From our discussion, this is how the error instance does it and it can stay.
It has to be returned for now so deletions work
johnsimons
approved these changes
Sep 24, 2026
johnsimons
left a comment
Member
There was a problem hiding this comment.
LGTM, but there is a question that i don't understand
rbev
force-pushed
the
audit-deterministic-ids
branch
from
September 25, 2026 05:54
8428c7c to
d045c8e
Compare
rbev
marked this pull request as ready for review
September 25, 2026 05:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Error-instance precedent
Verification
FailedAuditStorageTests— 6 passed in each.ServiceControl.Auditbuild passed.