Skip to content

docs: note that INatsJSMsg<T>.Metadata is nullable before accessing its properties#1080

Merged
mtmk merged 2 commits into
add-consumer-info-usage-warningsfrom
copilot/sub-pr-1079
Feb 26, 2026
Merged

docs: note that INatsJSMsg<T>.Metadata is nullable before accessing its properties#1080
mtmk merged 2 commits into
add-consumer-info-usage-warningsfrom
copilot/sub-pr-1079

Conversation

Copilot AI commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

The XML doc comment on RefreshAsync suggested using INatsJSMsg<T>.Metadata to track consumer progress without noting that the property is nullable (NatsJSMsgMetadata?), which could mislead callers into accessing NumPending, NumDelivered, Sequence, or Timestamp without a null check.

Changes

  • INatsJSConsumer.cs: Updated the RefreshAsync remarks to explicitly state that Metadata is nullable and must be checked for null before accessing any of its properties.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…d before use

Co-authored-by: mtmk <386903+mtmk@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP address feedback on consumer info usage warnings PR docs: note that INatsJSMsg<T>.Metadata is nullable before accessing its properties Feb 26, 2026
@mtmk
mtmk marked this pull request as ready for review February 26, 2026 13:02
@mtmk
mtmk merged commit 953560c into add-consumer-info-usage-warnings Feb 26, 2026
@mtmk
mtmk deleted the copilot/sub-pr-1079 branch February 26, 2026 13:02
mtmk added a commit that referenced this pull request Feb 27, 2026
* Add consumer info usage warnings

Add performance warnings about frequent `ConsumerInfo` API calls.

* Add GitHub Actions workflow for docs preview deployment via Netlify

* Update src/NATS.Client.JetStream/INatsJSContext.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/NATS.Client.JetStream/INatsJSConsumer.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Potential fix for code scanning alert no. 24: Workflow does not contain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* docs: note that INatsJSMsg<T>.Metadata is nullable before accessing its properties (#1080)

* Initial plan

* docs: clarify that INatsJSMsg.Metadata is nullable and must be checked before use

Co-authored-by: mtmk <386903+mtmk@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mtmk <386903+mtmk@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mtmk <386903+mtmk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants