Feat/resumable uploads - #24
Merged
Merged
Conversation
…leManifest with upload tracking fields
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements resumable uploads for Stash, allowing interrupted uploads to be resumed from where they left off. This is a major feature that significantly improves the user experience for large file uploads over unreliable connections.
🎯 Features Implemented
Core Functionality
Key Management Integration
📝 Changes Summary
File Changes
src/stash/core/manifest.py Added ChunkStatus & UploadStatus enums; extended ChunkInfo & FileManifest with status tracking fields; updated serialization/deserialization
src/stash/core/keymanager.py New KeyManager class for RMK management using OS keyring
src/stash/core/crypto.py Added derive_file_key_from_rmk() method for RMK-based key derivation
src/stash/core/exceptions.py Added KeyManagementError exception
src/stash/cli/commands/put.py Added --resume/--file-id flags; resume logic with incremental manifest saving
src/stash/cli/commands/key.py New key_commands group (lock, unlock, status, recovery)
src/stash/cli/main.py Registered key_commands group
src/stash/cli/commands/init.py Generates RMK on init, stores in keyring, displays recovery key
Testing
All 40 tests pass (34 unit + 6 integration):
UX Flow
First device:
stash init # Generates RMK, stores in OS keyring, shows recovery key
stash put file.zip # No password prompt - uses RMK from keyring
New device / recovery:
stash key-commands unlock --recovery-key # Restore RMK from recovery key
stash put file.zip # No password prompt
Interruption recovery:
stash put bigfile.zip --resume # Auto-detects by filename
stash put bigfile.zip --resume --file-id abc123 # Explicit file ID
Configuration
No new config required. Uses existing ~/.config/stash/config.json for provider settings. RMK stored in OS credential store:
Breaking Changes
Dependencies
Documentation Updates
Checklist
Related Issues
Reviewer Notes