Skip to content

SslStream.Write now throws IOException on write failure#412

Merged
josesimoes merged 1 commit into
nanoframework:mainfrom
josesimoes:fix-secure-socket-write
Jul 16, 2026
Merged

SslStream.Write now throws IOException on write failure#412
josesimoes merged 1 commit into
nanoframework:mainfrom
josesimoes:fix-secure-socket-write

Conversation

@josesimoes

Copy link
Copy Markdown
Member

Description

  • Now throws IOException when the write fails.
  • Add exceptions to IntelliSense comments.

Motivation and Context

How Has This Been Tested?

  • Added new unit test to cover this.

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (add new Unit Test(s) or improved existing one(s), has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist:

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).
  • I have added new tests to cover my changes.

@nfbot nfbot added Type: bug Something isn't working Type: documentation labels Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@josesimoes, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository: nanoframework/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1e7f7d7d-3379-44c3-8aa2-cc55a8a0d032

📥 Commits

Reviewing files that changed from the base of the PR and between fa06b3c and cb73989.

📒 Files selected for processing (1)
  • nanoFramework.System.Net/Security/SslStream.cs
📝 Walkthrough

Walkthrough

SslStream.Write documentation now lists its exception conditions, and the implementation throws IOException when SecureWrite writes no bytes for a positive-size request.

Changes

SslStream write handling

Layer / File(s) Summary
Write contract and error handling
nanoFramework.System.Net/Security/SslStream.cs
The Write documentation was expanded, and the method now checks SslNative.SecureWrite and throws IOException when no bytes are written for a non-empty buffer.

Estimated code review effort: 2 (Simple) | ~5 minutes

Suggested labels: Type: Unit Tests

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change and is clearly related to the write-failure handling update.
Description check ✅ Passed The description matches the change set by describing the IOException behavior, docs update, and test coverage.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@josesimoes

Copy link
Copy Markdown
Member Author

@coderabbitai review full

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

@josesimoes I’ll perform a full review of the PR, including the SslStream.Write failure handling, documentation, and test coverage.

✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@nanoFramework.System.Net/Security/SslStream.cs`:
- Line 432: Remove the stray trailing double quote from the XML exception
documentation in SslStream, leaving the cref and parameter description
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: nanoframework/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: eb1f02fb-43ee-4797-8597-6fec8b006f64

📥 Commits

Reviewing files that changed from the base of the PR and between e0b6dbc and fa06b3c.

📒 Files selected for processing (1)
  • nanoFramework.System.Net/Security/SslStream.cs

Comment thread nanoFramework.System.Net/Security/SslStream.cs Outdated
- Now throws `IOException` when the write fails.
- Add exceptions to IntelliSense comments.
@josesimoes
josesimoes force-pushed the fix-secure-socket-write branch from fa06b3c to cb73989 Compare July 16, 2026 17:54
@josesimoes
josesimoes merged commit de70dce into nanoframework:main Jul 16, 2026
8 checks passed
@josesimoes
josesimoes deleted the fix-secure-socket-write branch July 16, 2026 18:08
josesimoes added a commit that referenced this pull request Jul 16, 2026
***NO_CI***

(cherry picked from commit de70dce)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: bug Something isn't working Type: documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants