SWAT-engineering / SWAT-engineering/java-watch

Use an internal index to more accurately track renames on macOS

オープン
#49 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement
主要言語
Java
スター
1
フォーク
0
平均マージ
14時間 40分
マージ済み PR(30日)
1

説明

When a file is moved and we're using the native FSEvents API on macOS, it issues native events with flag ITEM_RENAMED set, but not flags ITEM_CREATED or ITEM_REMOVED. Typical cases include:

  1. Moving a file within the watch scope. In this case, there are two native events: one for the source (logically: delete), and one for the destination (logically: create).
  2. Moving a file into the watch scope. In this case, there is one native event, for the destination (logically: create).
  3. Moving a file out of the watch scope. In this case, there is one native event, for the source (logically: delete).

Because flags ITEM_CREATED and ITEM_REMOVED aren't set, the native events in cases 2 and 3 are indistinguishable. Currently, this is solved by asking the file system if the file exists: if it does, we assume it's case 2; if it doesn't, we assume it's case 3. However, this can be inaccurate (because things can have happened to the file between the native event was issued and asking the file system). A more accurate approach could be to maintain our own index.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず macOS FSEvents の処理を追跡し、ITEM_RENAMED、ITEM_CREATED、ITEM_REMOVED が現在どのように解釈されているかを確認します。次に、issue で説明されている 3 つの移動ケースを再現し、ファイルシステムの存在チェックだけに頼らず、監視対象範囲への移動、監視対象範囲外への移動、監視対象範囲内での移動を区別できることを完了条件として定義します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, macos
領域
operating-systems
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。