Skip to content

Propagate TUS upload body errors and close file handles#182

Closed
zerox80 wants to merge 1 commit into
opencloud-eu:mainfrom
zerox80:fix-tus-upload-body-errors
Closed

Propagate TUS upload body errors and close file handles#182
zerox80 wants to merge 1 commit into
opencloud-eu:mainfrom
zerox80:fix-tus-upload-body-errors

Conversation

@zerox80
Copy link
Copy Markdown
Contributor

@zerox80 zerox80 commented Jun 3, 2026

  • Propagate request body read failures during TUS uploads so OkHttp can abort the request and the server (tusd writeChunk) returns a meaningful error instead of treating a partial body as success. Previously, exceptions raised while streaming the request body were silently logged, leaving the client to believe the upload completed correctly.

  • Close the file handle used for creation-with-upload after the request completes. The previous code opened a RandomAccessFile and never closed it, leaking file descriptors and blocking file deletion on Windows.

  • Refactor CreateTusUploadRemoteOperation.run for readability (LongMethod detekt).

  • Add tests for body error propagation, file handle cleanup, and the creation-only path.

- propagate request body read failures during TUS uploads so OkHttp can abort and the server (tusd writeChunk) returns a meaningful error instead of treating a partial body as success
- close the file handle used for creation-with-upload after the request completes (the previous code opened a RandomAccessFile and never closed it, leaking file descriptors and blocking file deletion on Windows)
- refactor CreateTusUploadRemoteOperation.run for readability (LongMethod detekt)
- add tests for body error propagation, file handle cleanup, and the creation-only path
Copy link
Copy Markdown
Contributor Author

@zerox80 zerox80 left a comment

Choose a reason for hiding this comment

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

Looks good to me, what u think @guruz

@zerox80 zerox80 closed this Jun 3, 2026
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