-
Notifications
You must be signed in to change notification settings - Fork 1
fix(NATSRS-003): Info::cluster field uses skip_serializing_if but is Option<ClusterInfo>, missing Option::is_none guard #52
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| // Copyright 2020-2023 The NATS Authors | ||
| // Copyright 2020-2025 The NATS Authors | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
|
|
@@ -183,7 +183,7 @@ pub struct Info { | |
| /// The number of messages pending delivery | ||
|
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. 🦩 🟠 Info::cluster field uses skip_serializing_if but is Option, missing Option::is_none guard Changed 🤖 Prompt for AI agentsfix confidence: 🟢 95 high — react 👍/👎 to teach the reviewer |
||
| pub num_pending: u64, | ||
| /// Information about the consumer's cluster | ||
| #[serde(skip_serializing_if = "is_default")] | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| pub cluster: Option<ClusterInfo>, | ||
| /// Indicates if any client is connected and receiving messages from a push consumer | ||
|
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. 🦩 🔴 pause_remaining field gated on server_2_11 but pause_remaining is a Duration that can be zero when consumer is not paused — missing paused=false guard in deserialization Added a doc comment to 🤖 Prompt for AI agentsfix confidence: 🟡 72 medium — react 👍/👎 to teach the reviewer |
||
| #[serde(default, skip_serializing_if = "is_default")] | ||
|
|
@@ -193,8 +193,11 @@ pub struct Info { | |
| #[serde(default)] | ||
| pub paused: bool, | ||
| #[cfg(feature = "server_2_11")] | ||
| /// The remaining time the consumer is paused | ||
| #[serde(default, with = "serde_nanos")] | ||
| /// The remaining time the consumer is paused. | ||
| /// Only meaningful when `paused` is true. A value of `Some(Duration::ZERO)` or `None` | ||
| /// both indicate the consumer is not paused (or the pause has expired). | ||
| /// Always check the `paused` field as the authoritative gate before inspecting this value. | ||
| #[serde(default, with = "serde_nanos::option", skip_serializing_if = "Option::is_none")] | ||
| pub pause_remaining: Option<Duration>, | ||
| } | ||
|
|
||
|
Comment on lines
193
to
203
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. 🦩 🔴 Info::pause_remaining is Option but uses Changed 🤖 Prompt for AI agentsfix confidence: 🟢 92 high — react 👍/👎 to teach the reviewer
Comment on lines
193
to
203
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. 🦩 🟠 Info::pause_remaining Option field missing skip_serializing_if = "Option::is_none" Same change as finding 2 — the 🤖 Prompt for AI agentsfix confidence: 🟢 92 high — react 👍/👎 to teach the reviewer |
||
|
|
||
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.
🦩 🟠 Copyright year range ends at 2023 — may need updating for files modified in 2024/2025
Changed
// Copyright 2020-2023 The NATS Authorsto// Copyright 2020-2025 The NATS Authorson line 1. This is a mechanical year-range update. The only risk is if the project has a policy of using a different end year (e.g., the actual last modification year rather than the current year), but 2025 is consistent with the finding's suggestion.🤖 Prompt for AI agents
fix confidence: 🟢 90 high — react 👍/👎 to teach the reviewer