Symptôme
Créations et copies via GhD: → le fichier est bien présent en local mais l'Explorateur Windows ne se rafraîchit pas (nécessite F5).
Root cause
NotifyLocalChange dans notify_windows.go :
dir := filepath.Dir(localPath) // ex: "C:\GhostDrive\Backend"
C.ghd_notify_dir_change(wDir) // SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_PATH, dir, NULL)
SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_PATH, ...) sur Windows requiert que le chemin dossier se termine par un backslash. Sans cela, le shell ignore silencieusement la notification.
De plus, les appels depuis handleRemoteEvent passaient filepath.Dir(localPath) (déjà un dossier) à NotifyLocalChange qui en refaisait un filepath.Dir → chemin du dossier parent du parent (grand-parent).
Fix
internal/cfapi/notify_windows.go :
if !strings.HasSuffix(dir, string(filepath.Separator)) {
dir += string(filepath.Separator)
}
internal/sync/engine.go handleRemoteEvent :
Passer localPath (fichier) au lieu de filepath.Dir(localPath) pour que NotifyLocalChange calcule lui-même le dossier parent.
Symptôme
Créations et copies via GhD: → le fichier est bien présent en local mais l'Explorateur Windows ne se rafraîchit pas (nécessite F5).
Root cause
NotifyLocalChangedansnotify_windows.go:SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_PATH, ...)sur Windows requiert que le chemin dossier se termine par un backslash. Sans cela, le shell ignore silencieusement la notification.De plus, les appels depuis
handleRemoteEventpassaientfilepath.Dir(localPath)(déjà un dossier) àNotifyLocalChangequi en refaisait unfilepath.Dir→ chemin du dossier parent du parent (grand-parent).Fix
internal/cfapi/notify_windows.go:internal/sync/engine.go handleRemoteEvent:Passer
localPath(fichier) au lieu defilepath.Dir(localPath)pour queNotifyLocalChangecalcule lui-même le dossier parent.