Skip to content

Pr 174 comments#180

Merged
dborgards merged 3 commits intoissue/120from
cursor/pr-174-comments-7e64
Mar 6, 2026
Merged

Pr 174 comments#180
dborgards merged 3 commits intoissue/120from
cursor/pr-174-comments-7e64

Conversation

@dborgards
Copy link
Owner

Fixes open comments on PR #174 by improving stream size accounting, standardizing XML stream limits, clarifying maxInputSize docs, and refining writer argument validation.


Open in Web Open in Cursor 

@cursor
Copy link

cursor bot commented Mar 6, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>
@dborgards dborgards force-pushed the cursor/pr-174-comments-7e64 branch from b8e3bab to 086eb1b Compare March 6, 2026 18:19
Replace explicit ArgumentNullException throws with the project-wide
ThrowIfNull helper to satisfy CA1510 on net10.0.
@dborgards dborgards marked this pull request as ready for review March 6, 2026 18:28
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 196d2fbd0f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

On net10.0, use the Memory<char> overload of ReadAsync that accepts
a CancellationToken so callers can promptly abort blocked stream reads.
@dborgards dborgards merged commit d26415d into issue/120 Mar 6, 2026
4 checks passed
@dborgards dborgards deleted the cursor/pr-174-comments-7e64 branch March 6, 2026 18:38
dborgards added a commit that referenced this pull request Mar 6, 2026
* feat: add stream-based read/write APIs

Add Stream overloads for EDS, DCF, and CPJ operations:
- ReadEds(Stream), ReadEdsAsync(Stream)
- WriteEds(EDS, Stream), WriteEdsAsync(EDS, Stream)
- ReadDcf(Stream), ReadDcfAsync(Stream)
- WriteDcf(DCF, Stream), WriteDcfAsync(DCF, Stream)
- ReadCpj(Stream), WriteCpj(CPJ, Stream)

Stream ownership remains with the caller (leaveOpen: true).
14 stream round-trip tests added.

Closes #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* feat(io): add stream read/write APIs

Closes #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* fix(io): remove duplicate stream APIs and tighten parser limits

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* fix(io): satisfy analyzer null-guard requirements

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* fix(tests): disambiguate TextFileIo reflection overloads

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* fix(xdd/xdc): enforce stream input limits during read

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* docs(io): clarify stream ownership and size-limit units

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* ci(codecov): disable external patch status gate

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* refactor(io): remove unused stream read helpers

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* ci(codecov): keep patch gate with pragmatic threshold

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* docs(stream): further clarify ownership and stream roundtrip intent

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* test(stream): expand coverage across parser and writer stream paths

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* chore: update codecov.yml

undo changes from Cursor

Signed-off-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* test(coverage): hit writer exceptions and secure xml edge cases

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* fix(tests): import DcfWriteException namespace

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* fix: stabilize patch coverage for stream wrappers

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* Pr 174 comments (#180)

* fix: address PR 174 stream review findings

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* fix: use ThrowIfNull polyfill in stream writer guards

Replace explicit ArgumentNullException throws with the project-wide
ThrowIfNull helper to satisfy CA1510 on net10.0.

* fix: pass cancellation token to ReadAsync in IniParser

On net10.0, use the Memory<char> overload of ReadAsync that accepts
a CancellationToken so callers can promptly abort blocked stream reads.


* fix: address PR 174 review findings

- Remove [ExcludeFromCodeCoverage] from stream writer and parser methods
  that are exercised by tests
- Rename EnsureStreamWithinSizeLimit to EnsureStreamReadable and remove
  unused parameters (method no longer checks size limits)
- Buffer sync ParseReader with char[4096] instead of reading char-by-char,
  consistent with the async version

* test: cover CR/CRLF line endings and no-trailing-newline in stream parsing

Add sync and async tests for \r\n, bare \r, and missing trailing
newline to exercise all ProcessReaderCharacter and FlushPendingLine
branches.

* test: close remaining codecov gaps in ini/text io

* refactor: simplify writer stream null guards for coverage

* fix: address second round of PR 174 review findings

- Pass cancellation token to ReadAsync in IniParser and SecureXmlParser
  on net10.0 using Memory<char> overload
- Clarify maxInputSize XML docs as "decoded content length in characters"
  across all reader classes
- Remove unused using EdsDcfNet.Exceptions in DcfWriterTests

* fix: correct maxInputSize docs for file-path overloads

File-path overloads check file size in bytes; only stream/string
overloads enforce decoded character counts. Also replace null-forgiving
operator with explicit throw in SecureXmlParserTests.

* test: cover writer stream exception and null guards

---------

Signed-off-by: Dietmar Borgards <dborgards@users.noreply.github.com>
dborgards added a commit that referenced this pull request Mar 6, 2026
* feat: add stream-based read/write APIs

Add Stream overloads for EDS, DCF, and CPJ operations:
- ReadEds(Stream), ReadEdsAsync(Stream)
- WriteEds(EDS, Stream), WriteEdsAsync(EDS, Stream)
- ReadDcf(Stream), ReadDcfAsync(Stream)
- WriteDcf(DCF, Stream), WriteDcfAsync(DCF, Stream)
- ReadCpj(Stream), WriteCpj(CPJ, Stream)

Stream ownership remains with the caller (leaveOpen: true).
14 stream round-trip tests added.

Closes #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* feat(io): add stream read/write APIs

Closes #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* fix(io): remove duplicate stream APIs and tighten parser limits

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* fix(io): satisfy analyzer null-guard requirements

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* fix(tests): disambiguate TextFileIo reflection overloads

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* fix(xdd/xdc): enforce stream input limits during read

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* docs(io): clarify stream ownership and size-limit units

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* ci(codecov): disable external patch status gate

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* refactor(io): remove unused stream read helpers

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* ci(codecov): keep patch gate with pragmatic threshold

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* docs(stream): further clarify ownership and stream roundtrip intent

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* test(stream): expand coverage across parser and writer stream paths

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* chore: update codecov.yml

undo changes from Cursor

Signed-off-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* test(coverage): hit writer exceptions and secure xml edge cases

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* fix(tests): import DcfWriteException namespace

Refs #120

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* fix: stabilize patch coverage for stream wrappers

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* Pr 174 comments (#180)

* fix: address PR 174 stream review findings

Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>

* fix: use ThrowIfNull polyfill in stream writer guards

Replace explicit ArgumentNullException throws with the project-wide
ThrowIfNull helper to satisfy CA1510 on net10.0.

* fix: pass cancellation token to ReadAsync in IniParser

On net10.0, use the Memory<char> overload of ReadAsync that accepts
a CancellationToken so callers can promptly abort blocked stream reads.

* fix: address PR 174 review findings

- Remove [ExcludeFromCodeCoverage] from stream writer and parser methods
  that are exercised by tests
- Rename EnsureStreamWithinSizeLimit to EnsureStreamReadable and remove
  unused parameters (method no longer checks size limits)
- Buffer sync ParseReader with char[4096] instead of reading char-by-char,
  consistent with the async version

* test: cover CR/CRLF line endings and no-trailing-newline in stream parsing

Add sync and async tests for \r\n, bare \r, and missing trailing
newline to exercise all ProcessReaderCharacter and FlushPendingLine
branches.

* test: close remaining codecov gaps in ini/text io

* refactor: simplify writer stream null guards for coverage

* fix: address second round of PR 174 review findings

- Pass cancellation token to ReadAsync in IniParser and SecureXmlParser
  on net10.0 using Memory<char> overload
- Clarify maxInputSize XML docs as "decoded content length in characters"
  across all reader classes
- Remove unused using EdsDcfNet.Exceptions in DcfWriterTests

* fix: correct maxInputSize docs for file-path overloads

File-path overloads check file size in bytes; only stream/string
overloads enforce decoded character counts. Also replace null-forgiving
operator with explicit throw in SecureXmlParserTests.

* test: cover writer stream exception and null guards

---------

Signed-off-by: Dietmar Borgards <dborgards@users.noreply.github.com>
dborgards pushed a commit that referenced this pull request Mar 7, 2026
## [1.8.0-beta.2](v1.8.0-beta.1...v1.8.0-beta.2) (2026-03-07)

### ✨ Features

* Add model validation for CANopen constraints ([#173](#173)) ([6d24f89](6d24f89)), closes [#118](#118)
* add stream-based read/write APIs ([#174](#174)) ([9b33d79](9b33d79)), closes [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#180](#180)

### 🐛 Bug Fixes

* reject NodeId 0 in DCF model validation ([#182](#182)) ([11c1a7c](11c1a7c))
* remove accidental .claude worktree gitlink ([c456703](c456703))
dborgards pushed a commit that referenced this pull request Mar 7, 2026
## [1.8.0](v1.7.1...v1.8.0) (2026-03-07)

### ✨ Features

* Add model validation for CANopen constraints ([#173](#173)) ([6d24f89](6d24f89)), closes [#118](#118)
* add stream-based read/write APIs ([#174](#174)) ([9b33d79](9b33d79)), closes [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#120](#120) [#180](#180)
* improve EdsToDcf time source testability ([#185](#185)) ([4d22237](4d22237)), closes [#115](#115)
* make parser input size limits configurable ([#170](#170)) ([75f0978](75f0978))

### 🐛 Bug Fixes

* address Copilot review comments on PR [#197](#197) ([#198](#198)) ([cb3a371](cb3a371))
* improve invalid numeric literal error context ([#158](#158)) ([c57646d](c57646d))
* reject NodeId 0 in DCF model validation ([#182](#182)) ([11c1a7c](11c1a7c))
* remove accidental .claude worktree gitlink ([c456703](c456703))

### 📚 Documentation

* clarify UTF-8 no-BOM writer policy and interoperability ([#187](#187)) ([9ece6bb](9ece6bb)), closes [#130](#130)
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