Skip to content

fix(transfer): report unverified uploads as failures and truncate on download - #14

Merged
LordOfPolls merged 1 commit into
LordOfPolls:masterfrom
andreas-byfut:fix/file-transfer-integrity
Nov 14, 2026
Merged

LordOfPolls merged 1 commit into
LordOfPolls:masterfrom
andreas-byfut:fix/file-transfer-integrity

Conversation

@andreas-byfut

Copy link
Copy Markdown
Contributor
  • uploadFile returned success when the post-upload stat failed, although its KDoc counts that
    as a failure, and the download path already treats an unconfirmed transfer as one. It now
    returns a failure: "Uploaded, but could not confirm the file's size on the server".
  • Downloads to a SAF destination opened it with "w", which many document providers do not
    truncate. Overwriting a longer file left stale bytes at the end. They now use "wt", as
    ConfigExport already does. Append stays "wa".

Note: a transient stat error now shows a completed upload as failed.

Tests: UriFileTransferTest.

…download

uploadFile returned success when the post-upload stat failed, although its
KDoc treats that as a failure; it now returns a failure.

Downloads opened the SAF destination with mode "w", which many document
providers do not truncate, leaving stale trailing bytes when overwriting a
longer file. Use "wt".
@LordOfPolls
LordOfPolls merged commit 2225277 into LordOfPolls:master Nov 14, 2026
1 check passed
@LordOfPolls

Copy link
Copy Markdown
Owner

LGTM

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