Skip to content

fix: partial write error handling - #66

Merged
NguyenHoangSon96 merged 1 commit into
mainfrom
fix/partial-write-error-handling
Sep 30, 2026
Merged

NguyenHoangSon96 merged 1 commit into
mainfrom
fix/partial-write-error-handling

Conversation

@NguyenHoangSon96

@NguyenHoangSon96 NguyenHoangSon96 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #

Proposed Changes

  • How the errors are handled and test cases adjustment in this PR are heavily influenced by this PR.

Changes

  • Tests were modified to accommodate with new definitions of partial write errors, which are:
    - Error response status code is 400.
    - Error response format {"error":"...","data":[{"error_message":"...","line_number":2,"original_line": "..."}]} is returned with data must be an array.
    - accept_partial is set to true.
    - Write endpoint must be api/v3/write_lp.

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • Tests pass
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@NguyenHoangSon96 NguyenHoangSon96 self-assigned this Sep 21, 2026
@codecov-commenter

codecov-commenter commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.97%. Comparing base (7424b8b) to head (719f8bd).

Files with missing lines Patch % Lines
src/client.rs 89.18% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #66      +/-   ##
==========================================
+ Coverage   83.32%   83.97%   +0.65%     
==========================================
  Files          10       10              
  Lines        2027     2141     +114     
==========================================
+ Hits         1689     1798     +109     
- Misses        338      343       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@NguyenHoangSon96
NguyenHoangSon96 force-pushed the fix/partial-write-error-handling branch 2 times, most recently from 2ae0091 to f13af3f Compare September 21, 2026 07:17
@NguyenHoangSon96
NguyenHoangSon96 requested a lite review from Copilot September 21, 2026 07:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Documentation, error formatting, API compatibility, and skipped or incorrect test assertions remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 3 Medium severity

Open (3)
What changed in this PR

Updates partial-write error parsing and adds V2/V3 integration coverage.

Changes:

  • Adds structured partial-write messages and optional line numbers.
  • Expands write-error classification and response parsing.
  • Adds mock-server and end-to-end tests.
File Summary
tests/​write_tests.rs Adds response classification cases.
tests/​client.rs Adds V2, V3, and partial-write tests.
src/​error.rs Updates partial-write error structures.
src/​client.rs Parses and classifies write errors.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/error.rs
Comment thread tests/write_tests.rs Outdated
Comment thread tests/write_tests.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

A compile-breaking test issue and a moderate error-display defect remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity · 1 Low severity

Open (3)
Resolved since last review (3)

Comment thread tests/client.rs Outdated
Comment thread src/error.rs
Comment thread tests/write_tests.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

A test has a compile error, and several tests can pass without verifying the expected errors.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
Resolved since last review (3)

Comment thread tests/write_tests.rs Outdated
@NguyenHoangSon96
NguyenHoangSon96 force-pushed the fix/partial-write-error-handling branch from 96b71ef to 0c383ab Compare September 21, 2026 14:43
@NguyenHoangSon96
NguyenHoangSon96 marked this pull request as ready for review September 22, 2026 09:51
@NguyenHoangSon96
NguyenHoangSon96 force-pushed the fix/partial-write-error-handling branch 3 times, most recently from 0b1f4a4 to 47f34f8 Compare September 30, 2026 12:25
@NguyenHoangSon96
NguyenHoangSon96 force-pushed the fix/partial-write-error-handling branch from 0494e82 to 719f8bd Compare September 30, 2026 12:28

@karel-rehor karel-rehor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. 🚴 🏁

@NguyenHoangSon96
NguyenHoangSon96 merged commit a3232bf into main Sep 30, 2026
12 checks passed
@NguyenHoangSon96
NguyenHoangSon96 deleted the fix/partial-write-error-handling branch September 30, 2026 13:47
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.

4 participants