-
Notifications
You must be signed in to change notification settings - Fork 6
Implement ready-to-receive and send-files-to functionality in drop-core CLI #107
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
base: main
Are you sure you want to change the base?
Conversation
…re CLI - Added `run_ready_to_receive` and `run_send_files_to` functions to facilitate file transfers. - Introduced `ReadyToReceiveSubscriber` and `SendFilesToSubscriber` traits for event handling. - Enhanced CLI with new arguments for waiting to receive files and sending files to a receiver. - Updated Cargo.toml dependencies and added new modules for handling ready-to-receive operations. - Improved logging and progress tracking during file transfers. This commit enhances the user experience by allowing receivers to generate QR codes for easy connection and enabling senders to connect to waiting receivers using tickets and confirmation codes. Signed-off-by: Pushkar Mishra <[email protected]>
- Added `prompt_for_credentials` function for asynchronous user input of peer credentials. - Introduced QR code generation for ticket and confirmation codes to facilitate file transfers. - Updated CLI commands to allow for manual credential entry and improved user prompts. - Enhanced logging and error handling throughout the file transfer process. - Updated dependencies in `Cargo.toml` to include `qrcode` for QR code functionality. These changes improve the user experience by providing a seamless way to connect senders and receivers through QR codes or manual input of credentials. Signed-off-by: Pushkar Mishra <[email protected]>
Signed-off-by: Pushkar Mishra <[email protected]>
Signed-off-by: Pushkar Mishra <[email protected]>
Signed-off-by: Pushkar Mishra <[email protected]>
Benchmark for fe26a8eClick to view benchmark
|
|
@oluiscabral please review |
…e QR code functionality - Updated `Cargo.toml` to streamline dependency paths and remove duplicates. - Refactored imports in CLI and exchanges to use `arkdrop` namespaces consistently. - Improved QR code display and handling in file transfer processes for better user experience. - Cleaned up unused code and improved error handling in file receiving and sending logic. These changes enhance the maintainability of the codebase and improve the overall user experience during file transfers. Signed-off-by: Pushkar Mishra <[email protected]>
…ore CLI and receiver - Replaced `std::process::exit(0)` with `Ok(())` in file transfer cancellation and completion logic to improve error handling and maintain control flow. - Updated the `Carrier` implementation to enhance error management during task completion. These changes enhance the robustness of the file transfer process by allowing for better error propagation and control flow management. Signed-off-by: Pushkar Mishra <[email protected]>
Benchmark for c703179Click to view benchmark
|
Benchmark for b7830adClick to view benchmark
|
- Introduced new subcommands `wait-to-receive` and `send-to` for improved file transfer functionality. - Implemented argument parsing for both commands, allowing users to specify output directories, display names, and avatar options. - Enhanced the handling of file transfers with dedicated functions for waiting to receive files and sending files to a receiver. These changes enhance the usability of the CLI by providing clear commands for file transfer operations, improving the overall user experience. Signed-off-by: Pushkar Mishra <[email protected]>
- Improved error messages for accessing progress bars, file handles, and directory creation, providing clearer feedback during file transfer operations. - Refactored file length retrieval to use metadata for efficiency, reducing the complexity of the `len` function. - Enhanced logging for handshake and file reception failures in the `ReadyToReceiveHandler`, improving traceability of issues. These changes improve the robustness and user experience of the file transfer process by ensuring better error reporting and handling. Signed-off-by: Pushkar Mishra <[email protected]>
- Added new managers for handling sending files to a receiver and ready to receive operations. - Introduced new TUI pages for sending files to a receiver and monitoring the progress of file transfers. - Enhanced the home application to include options for sending files to and waiting to receive files, with corresponding navigation and status updates. - Implemented QR code rendering utilities for better user experience during file transfers. These changes significantly improve the file transfer capabilities of the TUI, providing users with clear options and feedback during the process. Signed-off-by: Pushkar Mishra <[email protected]>
- Added clipboard utility for copying text to the system clipboard, enhancing user experience during file transfers. - Updated various TUI components to streamline return statements and improve code readability. - Introduced new shortcuts for copying ticket and confirmation codes in the ready-to-receive and send files progress screens. - Refactored layout and helper footer components for better organization and clarity. These changes improve the overall usability and maintainability of the TUI, providing users with more intuitive interactions during file transfer operations. Signed-off-by: Pushkar Mishra <[email protected]>
- Increased the length constraint for connection info from 5 to 6 to accommodate additional information. - Adjusted the footer length constraint from 4 to 5 for better alignment and presentation. These changes enhance the user interface of the TUI, ensuring that all necessary information is displayed clearly during file transfer operations. Signed-off-by: Pushkar Mishra <[email protected]>
…ake module - Deleted the `prompt_for_credentials` function from the handshake module, as it is no longer needed. - This cleanup helps streamline the codebase by removing unnecessary components. Signed-off-by: Pushkar Mishra <[email protected]>
oluiscabral
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I created a few tickets based on this review, but they're not blocking. We can merge it, move on and then look back at them on another PR
| let is_reader_none = match self.reader.read() { | ||
| Ok(guard) => guard.is_none(), | ||
| Err(e) => { | ||
| eprintln!( | ||
| "Error acquiring read lock for file {}: {}", | ||
| self.path.display(), | ||
| e | ||
| ); | ||
| self.is_finished | ||
| .store(true, std::sync::atomic::Ordering::Relaxed); | ||
| return None; | ||
| } | ||
| }; | ||
|
|
||
| if is_reader_none { | ||
| match std::fs::File::open(&self.path) { | ||
| Ok(file) => { | ||
| *self.reader.write().unwrap() = Some(file); | ||
| } | ||
| Ok(file) => match self.reader.write() { | ||
| Ok(mut guard) => *guard = Some(file), | ||
| Err(e) => { | ||
| eprintln!( | ||
| "Error acquiring write lock for file {}: {}", | ||
| self.path.display(), | ||
| e | ||
| ); | ||
| self.is_finished | ||
| .store(true, std::sync::atomic::Ordering::Relaxed); | ||
| return None; | ||
| } | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff!
As note, I'll add a ticket for our team to discuss if a byte-by-byte reading is really needed 🤔
Maybe it's adding just extra complexity for us to handle, since it's not actually being used by any external consumer
oluiscabral
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The newly added use cases should be added to the bindings API (drop.udl)
- Introduced new `SendFilesToRequest` and `ReadyToReceiveRequest` structures to facilitate sending files to a receiver and waiting for a sender, respectively. - Implemented `SendFilesToBubble` and `ReadyToReceiveBubble` interfaces to manage the lifecycle of these sessions, including methods for starting, canceling, and subscribing to events. - Added necessary subscriber interfaces for both sender and receiver to handle progress notifications and connection events. - Updated the `drop.udl` file to define the new data structures and interfaces, enhancing the overall file transfer capabilities. These changes significantly improve the file transfer process by providing clear mechanisms for both sending and receiving files, enhancing user experience and functionality. Signed-off-by: Pushkar Mishra <[email protected]>
oluiscabral
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks good to me
There's just a question regarding why SenderFileDataAdapter has become public
|
Also formatter complains 😉 |
- Updated import statements in `home.rs`, `send_files_to.rs`, and `ready_to_receive.rs` for improved readability and organization. - Enhanced comments in `ready_to_receive_manager.rs` and `send_files_progress.rs` to clarify functionality and maintain consistency in code style. - Adjusted layout constraints in `send_files_to.rs` for better alignment and presentation. These changes contribute to a cleaner and more maintainable codebase, enhancing overall developer experience. Signed-off-by: Pushkar Mishra <[email protected]>
a6465e0 to
aa23fa0
Compare
- Introduced a new step to free disk space in the GitHub Actions workflow for Android bindings, optimizing resource usage during the build process. - Configured options to manage tool cache, .NET, Haskell, large packages, Docker images, and swap storage. These changes enhance the efficiency of the build process by ensuring adequate disk space is available, contributing to smoother CI/CD operations. Signed-off-by: Pushkar Mishra <[email protected]>
- Removed `pub(crate)` visibility from the `SenderFileDataAdapter` struct and its `inner` field to streamline access control. - This change simplifies the interface while maintaining encapsulation, contributing to a cleaner codebase. Signed-off-by: Pushkar Mishra <[email protected]>
oluiscabral
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
run_ready_to_receiveandrun_send_files_tofunctions to facilitate file transfers.ReadyToReceiveSubscriberandSendFilesToSubscribertraits for event handling.This Pull request enhances the user experience by allowing receivers to generate QR codes for easy connection and enabling senders to connect to waiting receivers using tickets and confirmation codes.