Fix edge-case bugs found in the 3.1 review#2081
Merged
Merged
Conversation
Six independent fixes surfaced by a careful review of the recent work, each with a regression test: - projectile-toggle-related-file: truename the visited file before spelling it relative to the (symlink-resolved) project root, so a project reached through a symlinked root no longer reports a spurious "No related files found" (same class as the frecency fix in 196e45c). - The reviewable replace/search help lines advertised \\[quit-window] (rendered as "C-x w q quit") instead of the actual `q' binding; use \\[projectile-replace--quit]. - projectile-purge-file/dir-from-cache mutated the cache but never re-derived the file-notify watches, so watches leaked on the purged path and a later create-event re-added the just-purged entries. Call projectile--maybe-watch-project on the shrunken cache, like projectile-cache-project does. - Session restore now visits files non-interactively (large-file warnings and unsafe file-local prompts suppressed), so restoring a session - especially on startup - never blocks Emacs on a yes-or-no-p. - A corrupt :window-state that still passes the version check no longer aborts the whole session restore; the layout error is caught and the recreated buffers are kept. - The async search/replace scan now carries a generation token, so a chunk timer that fires after its scan was superseded or canceled no-ops instead of appending to a newer scan's match list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A careful review of the recent v3.1 work (sessions, watches, async scan, reviewable replace/search, frecency, file kinds) turned up mostly solid code with a handful of real edge-case bugs. This fixes the six worth acting on, each with a regression test.
projectile-toggle-related-filebreaks under a symlinked project root - it hand-rolled the relative path and didn'tfile-truename, so you'd get a spurious "No related files found". Same class as the frecency fix in196e45c; routed through the documentedprojectile--project-relative-namehelper.\[quit-window]rendered as "C-x w q quit" instead of the actualq. Now\[projectile-replace--quit]in both help lines.projectile-purge-file/dir-from-cacheleaked watches - they mutated the cache without re-deriving the file-notify watches, so watches stayed on the purged path and a later create-event re-added the just-purged entries. Now callprojectile--maybe-watch-projecton the shrunken cache, likeprojectile-cache-project.find-file-noselectcan fire a large-file warning or an unsafe-file-locals prompt, which the surroundingignore-errorswon't suppress. Restore now visits files non-interactively.:window-stateaborted the whole restore - now caught (matching the buffer-recreation guard right above it), so the recreated buffers are kept.Nice-to-haves, doc drifts, the version-metadata
3.1.0-vs-3.2.0inconsistency, and the suggested test-coverage gaps (rg-vs-elisp parity, etc.) are left for follow-ups. 882 specs green, clean--warnings-as-errors, relint clean.