-
Notifications
You must be signed in to change notification settings - Fork 0
Resume Functionality Not Working as Intended #1
Description
The current implementation of the resume function does not reliably work after an interrupted upload. The goal is to provide users with the ability to gracefully handle upload interruptions and resume from where they left off. This improved resume functionality should function correctly provided the user restarts the application with the same user ID.
Proposed Implementation
This issue outlines the design and implementation details for the improved resume functionality. The key improvements will focus on enhanced progress tracking, robust resume capabilities, and improved error handling.
Enhanced Progress Tracking
The system will track the following information to enable accurate resuming:
- Folder Path: The directory being uploaded.
- Channel IDs: The IDs of the channels being uploaded to.
- Last Processed File: The exact file name of the last successfully uploaded file.
- Last Processed Channel: The ID of the last channel that completed uploading.
- Total File Count: The total number of files to be uploaded.
- Uploaded File Count: The number of files already successfully uploaded.
- Upload Completion Status: An overall indicator of upload progress (e.g., "in progress", "complete").
Resume Functionality
The application will implement the following to support resuming interrupted uploads:
- Detection of Incomplete Sessions: The system will identify upload sessions that were interrupted and did not reach completion. This could involve checking a status file, a database entry, or other persistent storage.
- Resume Prompt: Upon detecting an incomplete session, the application will prompt the user with an option to resume the upload.
- Precise Continuation: Resuming should begin at the exact file and channel where the previous session ended, using the tracked progress information.
- Progress Preservation: All tracked progress information will be preserved across application restarts (e.g., using a persistent storage mechanism like a file, database, or other method).
Error Handling
Robust error handling is crucial for a reliable resume functionality. The following will be implemented:
- Progress Saving Before Exit: Before exiting due to an error, the application will attempt to save the current progress information to prevent data loss.
- Progress Preservation During Interruptions: The application will be designed to handle interruptions gracefully, attempting to save progress updates periodically, in the case of interruptions.
- Clear Error Messages: Informative error messages will be displayed to the user to facilitate troubleshooting.
- Clean Resume After Errors: The system should allow a clean resume after errors, ensuring that corrupted data is handled appropriately and the application can resume from a consistent state.
Next Steps
This issue is open for discussion and contributions. Please comment with any questions, suggestions, or if you'd like to contribute to the implementation.