fix: prune deleted session files from index - #23
Open
vbp1 wants to merge 1 commit into
Open
Conversation
Sessions whose source .jsonl was deleted or moved lingered in the search index as ghost results. Pressing Enter on one silently did nothing, since re-parsing the missing file failed and the error was swallowed. - Add prune_deleted_files to drop index/state entries for files that no longer exist on disk; wire it into both background (TUI) and synchronous (CLI) indexing. - Surface a status-bar message on Enter when a session file is missing or unreadable instead of failing silently. - Add regression test covering prune removing a deleted session.
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.
Problem
Sessions whose source
.jsonlwas deleted or moved lingered in the search index as ghost results. Pressing Enter on such a result silently did nothing: re-parsing the now-missing file failed and the error was swallowed, so resume never happened and the user got no feedback.Changes
prune_deleted_files(src/index/indexer.rs) that drops index and state entries for files no longer present on disk, removing them from both the Tantivy index and the persistedstate.json.src/app.rsand synchronous (CLI) insrc/index/sync.rs. Both now run even when there are no new files to index.Tests
test_prune_removes_deleted_session_from_indexindexes a session, deletes its file, prunes, and asserts the ghost is gone from both the index and the state.cargo clippyclean.