Conversation
notify-debouncer-mini から notify-debouncer-full に移行し、 EventKind::Access を除外することで、ls コマンドによる atime 更新を ファイル変更と誤検知しないようにした。 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary of ChangesHello @zztkm, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! このプルリクエストは、 Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
src/subcommand_serve.rs
Outdated
| let should_rebuild = events.iter().any(|debounced_event| { | ||
| let path = match debounced_event.paths.first() { | ||
| Some(p) => p, | ||
| None => return false, | ||
| }; | ||
|
|
||
| // dist ディレクトリ以下は無視 | ||
| if path.starts_with(&dist_path) { | ||
| return false; | ||
| } | ||
|
|
||
| // Access イベント(ls による atime 更新など)は無視 | ||
| !matches!(debounced_event.kind, EventKind::Access(_)) | ||
| }); |
There was a problem hiding this comment.
現在の実装では、debounced_event.paths に複数のパスが含まれている場合、最初のパスしかチェックしていません。
DebouncedEvent が dist ディレクトリ内外両方のパスを含む場合、パスの順序によっては意図しない動作(再ビルドされない)を引き起こす可能性があります。
より堅牢にするために、debounced_event.paths 内のすべてのパスをチェックするように修正することを推奨します。
let should_rebuild = events.iter().any(|event| {
// Access イベントは無視
if matches!(event.kind, EventKind::Access(_)) {
return false;
}
// いずれかのパスが dist ディレクトリ外であれば再ビルド
event
.paths
.iter()
.any(|path| !path.starts_with(&dist_path))
});- import の順序を cargo fmt に合わせる - paths 内のすべてのパスをチェックするように修正 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
notify-debouncer-miniからnotify-debouncer-fullに移行EventKind::Accessイベントを除外することで、lsコマンドによる atime 更新をファイル変更と誤検知しないように修正問題
serveコマンド実行中にlsを実行すると、ファイル変更と誤検知されてビルドが走っていた。原因
notify-debouncer-miniはEventKindを提供せず(Anyのみ)、lsコマンドがディレクトリの atime を更新すると、これがnotifyのイベントとして検知され、EventKind::AccessとEventKind::Modifyを区別できなかった。Test plan
cargo build --releaseでビルド./target/release/vss serveを実行lsを実行 → ビルドが走らないことを確認🤖 Generated with Claude Code