Doc updates#21
Open
Conversation
Comment on lines
+47
to
50
| if (value <= 0) | ||
| { | ||
| throw new ArgumentOutOfRangeException(nameof(value), $"{nameof(BackgroundQueueSize)} must be non-negative."); | ||
| } |
There was a problem hiding this comment.
Bug: The validation for BackgroundQueueSize rejects 0, but the error message incorrectly states the value can be non-negative, creating a contradiction and a breaking API change.
Severity: MEDIUM
Suggested Fix
Update the error message for the BackgroundQueueSize property validation. Change the string from "{nameof(BackgroundQueueSize)} must be non-negative." to "{nameof(BackgroundQueueSize)} must be positive." to align with the validation logic that rejects zero.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/Logging.AzureAppServices/src/BatchingLoggerOptions.cs#L47-L50
Potential issue: The validation for `BackgroundQueueSize` was changed to reject a value
of `0`, but the corresponding error message was not updated. The code now throws an
`ArgumentOutOfRangeException` if the value is `0`, while the error message incorrectly
states that the value "must be non-negative" (>= 0). This creates a contradiction and is
a breaking change for a public API that previously accepted `0`. This behavior is also
inconsistent with similar properties like `BatchSize` in the same class, which use the
message "must be positive" when rejecting zero.
Did we get this right? 👍 / 👎 to inform future reviews.
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.
Benchmark PR from qodo-benchmark#96