mirror of
https://github.com/patriceckhart/zot.git
synced 2026-06-27 05:46:34 +02:00
fileSuggester.scan() cached the directory listing keyed only on the absolute path, and the only invalidation paths (Reset / Invalidate / SetCWD) never fired for in-place filesystem changes. Once the picker had scanned the cwd, any later mkdir or touch was invisible until zot restarted. Key the cache on (path, mtime) instead. Stat the browse directory on every scan and re-read when its ModTime has moved; OSes bump dir mtime on every entry add / remove / rename, so the picker now reflects the filesystem within a keystroke. Stat is one cheap syscall and only runs while the popup is open, so the input loop stays responsive on large repos. Added TestFileSuggesterPicksUpNewEntries to pin the behaviour: scan, sleep past the fs mtime tick, mkdir, scan again, expect the new dir. |
||
|---|---|---|
| .. | ||
| agent | ||
| assets | ||
| auth | ||
| core | ||
| extproto | ||
| provider | ||
| skills | ||
| swarm | ||
| tui | ||