-
-
Notifications
You must be signed in to change notification settings - Fork 13
Fix NRT errors and enable TreatWarningsAsErrors #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
c0e1e9e
68f2a83
b482b82
bfc0638
03b47fb
51506c7
f9dd5b5
8ec53c0
495f7f6
e795f95
63c518a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ namespace Foundatio.AzureStorage.Samples; | |
|
|
||
| public record SampleMessage | ||
| { | ||
| public string Message { get; init; } = string.Empty; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. feels like these should be made required and we should not be using String.Empty ever for defaults.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed: SampleMessage now uses |
||
| public required string Message { get; init; } | ||
| public DateTime Timestamp { get; init; } = DateTime.UtcNow; | ||
| public string Source { get; init; } = string.Empty; | ||
| public required string Source { get; init; } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -27,8 +27,7 @@ public class AzureStorageQueue<T> : QueueBase<T, AzureStorageQueueOptions<T>> wh | |||||||||||
|
|
||||||||||||
| public AzureStorageQueue(AzureStorageQueueOptions<T> options) : base(options) | ||||||||||||
| { | ||||||||||||
| if (String.IsNullOrEmpty(options.ConnectionString)) | ||||||||||||
| throw new ArgumentException("ConnectionString is required."); | ||||||||||||
| ArgumentException.ThrowIfNullOrWhiteSpace(options?.ConnectionString, nameof(options.ConnectionString)); | ||||||||||||
|
||||||||||||
| ArgumentException.ThrowIfNullOrWhiteSpace(options?.ConnectionString, nameof(options.ConnectionString)); | |
| ArgumentNullException.ThrowIfNull(options); | |
| ArgumentException.ThrowIfNullOrWhiteSpace(options.ConnectionString, nameof(options.ConnectionString)); |
Copilot
AI
Apr 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When data ends up null but no exception was thrown during deserialization (e.g., payload is literal null or an envelope deserializes with Data=null), deserializeException remains null and the log message still says "Error deserializing". Consider handling the deserializeException == null case separately (e.g., log that the payload was null) so operational logs accurately describe why the message is being abandoned/dead-lettered.
| _logger.LogWarning(deserializeException, "Error deserializing message {MessageId} (attempt {DequeueCount}), abandoning for retry", message.MessageId, message.DequeueCount); | |
| if (deserializeException is null) | |
| _logger.LogWarning("Message {MessageId} deserialized to null payload (attempt {DequeueCount}), abandoning for retry", message.MessageId, message.DequeueCount); | |
| else | |
| _logger.LogWarning(deserializeException, "Error deserializing message {MessageId} (attempt {DequeueCount}), abandoning for retry", message.MessageId, message.DequeueCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is invalid feedback, it's fine to pass null for the exception here and it's what the logging api's do internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description mentions replacing
<WarningsAsErrors>with<TreatWarningsAsErrors>, but this repo doesn’t appear to contain<WarningsAsErrors>anywhere, andTreatWarningsAsErrorsis already present here. Please update the PR description (or include the missing change) so it accurately reflects what’s actually being modified (e.g., enabling<Nullable>enable</Nullable>in this file).