Skip to content

Reuse valid search indexes without delaying notebook loading - #55

Merged
emsi merged 2 commits into
masterfrom
feature/54-index-reuse
Aug 16, 2026
Merged

Reuse valid search indexes without delaying notebook loading#55
emsi merged 2 commits into
masterfrom
feature/54-index-reuse

Conversation

@emsi

@emsi emsi commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • reuse a published search-index generation only when source identity, fingerprint, schema, projection version, and projection profile all match
  • move source loading and serialized index mutation onto independent workers with source-scoped generations and cancellation
  • report reused, rebuilt, failed, and pending index work without exposing notebook content
  • preserve notebook presentation order independently from restored-source load priority

Motivation

Startup previously deleted and rebuilt every successfully loaded notebook's search documents, even when the source and indexed projection were unchanged. Indexing also ran on the source-loading worker, so rebuilding one notebook delayed loading the next.

The optimized startup initially prioritized the last active notebook correctly but accidentally allowed load completion order to become navigation order. This PR keeps the restored source first in the work queue while inserting completed notebooks into their persisted presentation positions.

Validation

  • cargo test --workspace
  • cargo clippy --workspace --all-targets -- -D warnings
  • scripts/validate-docs.sh
  • isolated native GUI smoke test
  • GitHub Actions release workflow, including native tests, Flatpak build and bundled-extractor smoke test, and AppImage build and smoke test: https://github.com/emsi/OneNoteViewer/actions/runs/31964874546
  • regression tests verify unchanged index reuse, transactional replacement, stale-work cancellation, non-blocking loading, persisted source order, and GTK positional insertion

Closes #54
Related to #37
Builds on #38

emsi added 2 commits August 16, 2026 16:17
Persist an explicit index projection profile, migrate existing indexes without discarding their last published data, and skip writes when source validity inputs still match.

Move source loading and index maintenance onto independent serialized workers with source-scoped generations, cancellation, startup prioritization, and aggregate status reporting.

Refs: #54
Keep startup restoration priority independent from the persisted notebook sequence, and insert asynchronously loaded notebooks at their reserved navigation positions. Preserve source order during workspace normalization and cover the prioritized-load regression at both state and GTK model boundaries.

Refs: #54
@emsi
emsi merged commit ef378f1 into master Aug 16, 2026
4 checks passed
@emsi
emsi deleted the feature/54-index-reuse branch August 16, 2026 18:56
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.

Reuse valid search indexes and decouple startup indexing

1 participant