Skip to content

fix: make interrupted indexing retryable and reset cancelled dialogs - #212

Merged
mrsibe merged 1 commit into
mainfrom
fix/interrupted-indexing-dialog-cancel
Oct 1, 2026
Merged

mrsibe merged 1 commit into
mainfrom
fix/interrupted-indexing-dialog-cancel

Conversation

@mrsibe

@mrsibe mrsibe commented Oct 1, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

Fixes the remaining Quiz/Anki Cancel reset paths and makes interrupted indexing visible and retryable after restarting the desktop app.

Why?

Cancel buttons bypassed the dialogs' reset handlers, leaving temporary question/card counts, difficulty, and prompts behind when reopening.

The ingestion queue is in memory. Exiting during indexing left persisted documents in pending or processing, displaying an indexing spinner indefinitely without a Retry action.

What changed?

  • Route both Cancel buttons through their existing handleOpenChange(false) reset paths.
  • After database migrations and before starting ingestion services or watched-folder reconciliation, mark leftover pending/processing documents as failed.
  • Persist an interruption explanation and update the timestamp so the existing failed-source UI exposes the error and Retry action.
  • Preserve source content, local paths, chunk counts, and completed/previously failed documents.
  • Add SQL-backed regression coverage for status recovery, preservation of source data, idempotence, startup ordering, and both Cancel paths.

This is deliberately not a durable queue or automatic resume implementation. Existing retry prerequisites still apply: a source needs saved content or a local copy. A URL interrupted before either is saved may need to be imported again.

How was this tested?

  • npm test: 493/493 tests passed.
  • npm run build: passed, including the full npm run typecheck gate.
  • npm run build:unpack: passed on Linux x64.
  • npm run smoke:packaged: passed, including 29 packaged-app checks.
  • Targeted ESLint: no errors; two existing no-explicit-any warnings.
  • git diff --check: passed.
  • The recovery SQL was exercised against an in-memory SQLite database. A manual exit/relaunch during a real indexing job and interactive Cancel/reopen testing were not performed.

Checklist

  • I have reviewed my own changes.
  • npm run typecheck passes.
  • npm run build passes.
  • I have tested the affected user workflow.
  • I have not included unrelated changes.
  • I have updated documentation when necessary. (No separate documentation changes needed.)

Desktop / build changes

  • Not applicable
  • npm run build:unpack passes.
  • npm run smoke:packaged passes.

@github-actions github-actions Bot added the bug Something isn't working label Oct 1, 2026
@mrsibe
mrsibe merged commit daf304c into main Oct 1, 2026
4 checks passed
@mrsibe
mrsibe deleted the fix/interrupted-indexing-dialog-cancel branch October 1, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant