Skip to content

Import Tasks: switching source blanks the list and re-flashes the loading spinner every time #3904

Description

@liuxiaocs7

What happened

In Settings → Activity → Import Tasks, changing the source (Codex / Claude Code / opencode) — including switching back to a source that was already loaded — blanks the conversation list and flashes the full-width "Reading external conversations…" spinner on every switch, then re-fetches from scratch.

Expected: returning to a source (or archived/search filter) that was already loaded should show its rows immediately, without blanking the list and re-showing the spinner each time.

How to reproduce

(Requires at least two sources that have conversations on the machine, so the source switcher renders.)

  1. Open Settings → Activity → Import Tasks.
  2. Wait for the first source to finish loading its list.
  3. Switch to another source; wait for it to load.
  4. Switch back to the first source.

Observed: the list blanks and "Reading external conversations…" appears again, even though that source was loaded a moment ago. With a slow catalog read the spinner is visible for a noticeable time on every switch.

Environment

  • Maka commit: 654764fb4 (origin/main)
  • OS and version: macOS (Apple Silicon)
  • Surface: Desktop
  • Node.js version: v24.14.0

Logs, screenshots, or additional context

Root cause is in apps/desktop/src/renderer/settings/import-tasks-settings-page.tsx: loadCatalog unconditionally calls setCatalog(EMPTY_CATALOG) + setCatalogLoading(true) on every non-append load, and there is no per-selection cache — so every source/filter change fully blanks the list and re-fetches, even for a selection just viewed.

Separately (latent, not the visible symptom): the background import poll refreshLoadedCatalog shares the same requestGeneration counter that gates the catalogLoading reset, but never resets catalogLoading itself — a fragile coupling worth hardening.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions