Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Transfer Stoppage: Clear Partial Content and Implement Failure Recovery #5

Open
SaiDheerajPeketi opened this issue Oct 6, 2024 · 0 comments
Labels
bug Something isn't working enhancement New feature or request hard level SaiDheerajPeketi mentor

Comments

@SaiDheerajPeketi
Copy link

🐛Bug-Report

Expected behavior

When a file transfer is stopped unexpectedly (e.g., forcefully stopping the app or losing connection), the app should automatically clear any partially transferred content and either retry the transfer or notify the user of the failure. If the transfer fails completely, the content should be discarded to avoid incomplete or corrupt files being saved.

Current behavior

Currently, if a transfer is stopped mid-process, the partially transferred file may remain on the receiver’s device without any indication that the transfer failed. This can result in incomplete files being stored, causing confusion for the user or even leading to data corruption.

Steps to reproduce

  1. Start a file transfer from one device (preferably the sender’s end).
  2. While the transfer is in progress, forcefully stop the process (e.g., close the app or disconnect the device).
  3. Check the receiver’s device to see if any partial content is stored.
  4. Restart the app and attempt to resume or handle the incomplete transfer.

Possible Solution

  1. Clear Partial Content: On transfer failure (whether due to disconnection or forceful closure), ensure that any incomplete files on the receiver's side are automatically deleted.

  2. Error Handling and Retry Logic: Implement error handling to detect when the transfer has been interrupted. Notify the user that the transfer failed and give the option to retry the transfer. The app should not save any incomplete content in case of failure.

  3. Progress Checkpointing: If implementing resuming functionality is required, you can store checkpoints of the progress and resume from where the transfer left off. However, this must be tied to a proper validation step to ensure file integrity (e.g., hash digest comparison).

  4. Timeouts and Feedback: Add timeouts for detecting stalled transfers and provide visual or audible feedback to the user, explaining that the transfer has failed and clearing the content accordingly.

@SaiDheerajPeketi SaiDheerajPeketi added bug Something isn't working enhancement New feature or request SaiDheerajPeketi mentor hard level labels Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request hard level SaiDheerajPeketi mentor
Projects
None yet
Development

No branches or pull requests

1 participant