You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This release PR only bumps version.txt from 2.8.0 to 2.8.1. All substantive changes landed via the referenced PRs already merged to main. I reviewed each bug fix and the new service-error helpers below.
TimeoutValidation.Validate correctly handles all sentinels: null, TimeSpan.MaxValue, and Timeout.InfiniteTimeSpan are all returned as the caller-specified "no timeout" result before the range check fires. The Timeout.InfiniteTimeSpan == TimeSpan.FromMilliseconds(-1) case is caught before v < TimeSpan.Zero, so the ordering is correct. Applied to all three NatsSubBase timeout fields and ReplyTask. No issues.
HandleServerError correctly centralises log dispatch and TrySetObservedException is still called unconditionally (outside the level switch), so reconnect behaviour is unchanged. The ParseError slicing change (from GetOffset(position.Value) - 1 to position.Value then lineWithCR.Length - 1) produces identical results—cleaner two-step strip. No issues.
Straightforward ADR-8 implementation. The 2-minute default constant is applied before the MaxAge cap, and applied on both create and update paths. No issues.
Fix: Durable consumer create when only DurableName is set (#1150)
The name-resolution order (Name → DurableName fallback) is correct. ThrowIfInvalidConsumerName is called on the resolved name, so invalid chars in a supplied DurableName are caught on the fallback path. One minor note: if a caller sets bothName (valid) and DurableName (invalid chars), the invalid DurableName is not validated client-side, since Name wins. The server will reject the request, but the exception type will be different from the local ArgumentException. Very edge-case, noted for awareness. No blocking issue.
GetServiceStatus(false).IsSuccess returns false (IsSuccess = Message is null && !HasNoResponders).
A user who switches from IsServiceSuccess to GetServiceStatus after reading the docs may be surprised. IsServiceSuccess is documented as a header-check so it's technically correct, but the naming implies broader correctness. Callers opting out of the no-responders throw should prefer GetServiceStatus for full fidelity.
2. An empty Nats-Service-Error header value causes EnsureServiceSuccess to throw with an empty message.
LastValueOrEmpty returns "" when the header value is present but empty. NatsSvcStatus.FromError(0, "") sets Message = "" (non-null), so EnsureServiceSuccess throws NatsSvcEndpointException(0, ""). This is technically correct (the header was set = error), but the resulting exception is not helpful. If a server misbehaves and sends a blank error header the caller gets Code=0, Message="" with no diagnostics. A null-or-whitespace guard in LastValueOrEmpty / FromError could improve this, though it's a very edge case.
Summary
All bug fixes are correct and well-tested. The new service-error API is solid; the two observations above are design-level notes rather than correctness bugs. This patch release is ready from a code-review perspective.
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
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.
Patch release with bug fixes and a Services helper addition for detecting service errors on responses.