F-002: refactor(app): make hook and clipboard methods non-blocking (re-do)#34
Merged
Sephyi merged 1 commit intodevelopmentfrom Apr 30, 2026
Merged
F-002: refactor(app): make hook and clipboard methods non-blocking (re-do)#34Sephyi merged 1 commit intodevelopmentfrom
Sephyi merged 1 commit intodevelopmentfrom
Conversation
Replaces the F-018 sequencing shim at `src/app.rs:1030` with a real
async migration of the two paths the audit flagged for blocking the
Tokio runtime.
Hook path:
- `hook_dir` → `async fn`, uses `tokio::process::Command` for
`git rev-parse --git-dir` (with the explicit `std::process::Output`
type annotation per CLAUDE.md gotcha).
- `hook_path`, `hook_install`, `hook_uninstall`, `hook_status`,
and `handle_hook` are all `async fn` and `.await` the chain.
- `Commands::Hook { action }` dispatch in `handle_command` now
`.await`s `handle_hook`.
Clipboard path:
- `arboard` is a synchronous library (not a subprocess), so the
correct fix is `tokio::task::spawn_blocking` rather than
`tokio::process::Command`.
- `copy_to_clipboard` now takes `String` (owned, since it crosses the
blocking-task boundary) and returns the result via `await`.
- The `--clipboard` flow in `generate_commit` calls `await` on the
helper.
The `#[allow(clippy::disallowed_methods)]` shim added in #21 (F-018)
is removed — the lint now has nothing to suppress in this file.
Closes #11.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Re-implementation of closed #11 on top of current development. Replaces the
#[allow(clippy::disallowed_methods)]shim added in #21 with a real async migration:tokio::process::Commandforgit rev-parse --git-dir(with thestd::process::Outputtype annotation per CLAUDE.md gotcha).hook_dir/hook_path/hook_install/hook_uninstall/hook_status/handle_hookare nowasync fn.tokio::task::spawn_blocking(arboardis sync, not a subprocess).Closes #11.
Test plan