Skip to content

🐛 Clean up pending transfer on upload interruption#26

Merged
HanXHX merged 1 commit intomasterfrom
manage_aborted_transfer
Mar 13, 2026
Merged

🐛 Clean up pending transfer on upload interruption#26
HanXHX merged 1 commit intomasterfrom
manage_aborted_transfer

Conversation

@HanXHX
Copy link
Contributor

@HanXHX HanXHX commented Mar 13, 2026

On SIGINT/SIGTERM, during a transfer, perform a deleting of the transfer in "pending" state.

Copilot AI review requested due to automatic review settings March 13, 2026 15:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an explicit “force delete” API call and wires SIGINT/SIGTERM handling into transfer create so that interrupted uploads don’t leave orphaned pending transfers on the server.

Changes:

  • Add Client.ForceDeleteTransfer() (DELETE /share/{id}/force) for permanently deleting pending transfers.
  • In transfer create, install a SIGINT/SIGTERM handler after share creation; on interruption cancel ongoing upload work and force-delete the pending transfer.
  • Prompt for a passphrase earlier (when determinable) to avoid creating a server-side pending share during interactive passphrase entry.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
internal/api/transfer.go Adds ForceDeleteTransfer API method used for cleanup of pending transfers.
cmd/transfer.go Adds signal handling + cleanup logic during transfer creation/upload and adjusts passphrase prompting order.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

On SIGINT/SIGTERM, during a transfer, perform a deleting of the transfer
in "pending" state.
@HanXHX HanXHX force-pushed the manage_aborted_transfer branch from 75cce3e to 05139c4 Compare March 13, 2026 16:36
@HanXHX HanXHX merged commit 1bc6f94 into master Mar 13, 2026
4 checks passed
@HanXHX HanXHX deleted the manage_aborted_transfer branch March 13, 2026 16:40
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