Skip to content

docs(transfer): document detecting upload interruptions#641

Merged
fclairamb merged 3 commits into
mainfrom
feat/detect-upload-interruption
May 25, 2026
Merged

docs(transfer): document detecting upload interruptions#641
fclairamb merged 3 commits into
mainfrom
feat/detect-upload-interruption

Conversation

@fclairamb
Copy link
Copy Markdown
Owner

Summary

Clarifies and tests how drivers detect an interrupted upload via the existing FileTransferError interface, in response to #635.

  • Documents on the FileTransferError godoc and in the README that TransferError fires before Close on ABOR, a dropped data/control connection, or an I/O error — and that a graceful mid-upload close is indistinguishable from completion (FTP has no STOR length header), so only Close runs in that case.
  • Adds TestFileTransferErrorNotification covering: clean upload (no TransferError), write failure, ABOR mid-upload, and a dropped connection mid-upload (the Is it possible to detect an upload interruption event? #635 scenario).
  • Test driver now tracks the files it hands out, and errTransfer is mutex-guarded so the connection-drop case can be polled race-free.

No production behaviour change — the interface already worked; this documents the contract and locks it in with tests.

Test plan

  • go test -race -count=1 . passes (full suite)
  • TestFileTransferErrorNotification passes under -race (clean / write-error / ABOR / dropped-connection)
  • golangci-lint run introduces no new findings vs. base

Refs #635

🤖 Generated with Claude Code

fclairamb and others added 2 commits May 25, 2026 15:36
…tection

Clarify, in the godoc and README, that the FileTransferError interface is
the supported way to detect an interrupted upload (issue #635): TransferError
fires before Close on ABOR, a dropped data/control connection, or an I/O
error, while a graceful mid-upload close is indistinguishable from completion
due to the lack of a STOR length header.

Add TestFileTransferErrorNotification covering clean upload, write failure,
ABOR mid-upload, and a dropped connection mid-upload (the #635 scenario). The
test driver now tracks the files it hands out and guards errTransfer with a
mutex so the connection-drop case can be polled race-free.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
golangci-lint v2.12.2 (CI) flags the new raw.SendCommand(getABORCmd())
line as a non-constant printf format string; pass the command as an
argument instead.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.22%. Comparing base (556b9e0) to head (0691576).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #641   +/-   ##
=======================================
  Coverage   87.22%   87.22%           
=======================================
  Files          13       13           
  Lines        2090     2090           
=======================================
  Hits         1823     1823           
  Misses        180      180           
  Partials       87       87           

☔ View full report in Codecov by Sentry.
📢 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.

@fclairamb fclairamb enabled auto-merge (squash) May 25, 2026 15:13
@fclairamb fclairamb merged commit 358311e into main May 25, 2026
6 checks passed
@fclairamb fclairamb deleted the feat/detect-upload-interruption branch May 25, 2026 15:14
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.

1 participant