You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Coalesce idle-timer flushes in projectile-cache-current-file
Each call to `projectile-cache-current-file' under persistent caching
scheduled a fresh 30-second idle timer that closed over a snapshot of
the file list at scheduling time. Opening N files in a session
queued N timers; once Emacs went idle they all fired and serialized
the cache N times, with the earlier ones writing stale (shorter)
lists.
Maintain a per-project pending timer in
`projectile--pending-cache-flush-timers' instead, cancelling and
rescheduling on each new file. The fired callback re-reads the
current in-memory cache, so the disk write reflects the final state
rather than whichever snapshot the last timer captured.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,7 @@
42
42
* Fix `projectile--other-extension-files` sort comparator ignoring its second argument, producing undefined ordering; replaced with a stable partition.
43
43
* Fix `projectile-toggle-project-read-only` operating on the wrong buffer after `add-dir-local-variable` by wrapping in `save-selected-window`.
44
44
* Fix `projectile-cache-current-file` calling `projectile-project-root` twice instead of reusing the already-resolved value.
45
+
* Fix `projectile-cache-current-file` queueing one idle timer per opened file, each capturing a stale snapshot of the file list. With persistent caching, opening many files in a session would result in N redundant disk writes after Emacs went idle. A pending flush is now coalesced per project and reads the latest in-memory cache at fire time.
45
46
* Fix `projectile-load-project-cache` not recording a cache time, which combined with `projectile-files-cache-expire` made the TTL check immediately re-evict freshly loaded data — every call ended up re-reading the cache file from disk and the data was never reindexed. The cache file's mtime is now used to seed `projectile-projects-cache-time`.
46
47
* Fix `projectile-load-project-cache` storing nil in cache on corrupt/empty cache files, preventing future reload attempts.
47
48
* Fix `projectile-purge-dir-from-cache` only updating the in-memory cache; with persistent caching the purged directory's files would reappear on the next session. The on-disk cache is now updated as well, matching the behavior of `projectile-purge-file-from-cache`.
0 commit comments