Skip to content

fix: prune deleted session files from index - #23

Open
vbp1 wants to merge 1 commit into
zippoxer:mainfrom
vbp1:fix/prune-deleted-sessions
Open

fix: prune deleted session files from index#23
vbp1 wants to merge 1 commit into
zippoxer:mainfrom
vbp1:fix/prune-deleted-sessions

Conversation

@vbp1

@vbp1 vbp1 commented Jun 19, 2026

Copy link
Copy Markdown

Problem

Sessions whose source .jsonl was 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

  • Add 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 persisted state.json.
  • Wire pruning into both indexing paths: background (TUI) in src/app.rs and synchronous (CLI) in src/index/sync.rs. Both now run even when there are no new files to index.
  • On Enter, show a status-bar message when a session file is missing or unreadable instead of failing silently.

Tests

  • New regression test test_prune_removes_deleted_session_from_index indexes a session, deletes its file, prunes, and asserts the ghost is gone from both the index and the state.
  • Full suite green; cargo clippy clean.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant