-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Summary
Implement transaction abort functionality in the PreflightExec modal. Currently, pressing 'x' only shows a toast message but doesn't actually abort the running PTY process that executes package operations (install/remove/downgrade/update).
Files to modify
src/events/modals/common.rs(around line 256)src/app/runtime/workers/executor.rs(communication and abort signaling)src/app/runtime/channels.rs(add abort channel)
Expected behavior
When users press 'x' in the PreflightExec modal during execution:
- Signal the executor worker to abort the current operation
- Kill the running PTY child process gracefully
- Clean up any temporary resources and file handles
- Show appropriate feedback about the aborted operation
- Return to a safe state allowing retry or cancellation
Implementation approach
-
Add abort signaling infrastructure:
- Add an abort channel to the Channels struct
- Pass abort receiver to executor worker
- Send abort signal from UI when 'x' is pressed
-
Modify PTY execution:
- Check for abort signal in the execution loop
- Kill child process when abort is requested
- Handle cleanup and proper exit
-
Update UI state:
- Transition modal to appropriate state after abort
- Show clear user feedback about aborted operation
- Handle edge cases (process already finished, abort failed, etc.)
Testing
-
cargo checkpasses -
cargo clippy --all-targets --all-features -- -D warningspasses -
cargo test -- --test-threads=1passes - Test abort during install operations
- Test abort during remove operations
- Test abort during long-running operations
- Test abort when process finishes naturally (race condition)
- Test multiple abort attempts
- Test abort cleanup and resource management
Additional context
The current PTY execution uses portable_pty and runs bash commands in a spawned child process. The executor worker runs in a separate tokio task, so implementing abort requires inter-task communication. Follow the existing channel patterns used for other executor communications.
Key considerations:
- Handle race conditions between process completion and abort requests
- Ensure proper cleanup of PTY resources and file descriptors
- Provide clear user feedback for different abort scenarios
- Maintain compatibility with existing dry-run functionality
- Consider platform differences (Unix vs Windows execution)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed