Skip to content

Multi-source Phase C3: background-activity dashboard + enable→auto-sync (#99)#103

Open
jozef2svrcek wants to merge 1 commit into
mainfrom
multi-source-c3-activity-autosync
Open

Multi-source Phase C3: background-activity dashboard + enable→auto-sync (#99)#103
jozef2svrcek wants to merge 1 commit into
mainfrom
multi-source-c3-activity-autosync

Conversation

@jozef2svrcek

Copy link
Copy Markdown
Contributor

Phase C3 of multi-source (#40). Two parts.

enable → auto-background-sync (backend)

Enabling a source in Maintenance → Sources no longer requires pressing Sync now. The scheduler's ~60s tick now imports enabled-but-not-yet-synced sources in the background (works with the GUI closed).

  • sources::auto_sync_candidates = enabled AND last_run IS NULL (and has a feed driver). A source that synced ok, failed, or was cancelled has last_run set → not auto-retried (manual "Sync now" stays); a sync interrupted by a crash/restart never recorded a run → resumes.
  • sources_sync now records its terminal status (ok / error / cancelled). Errors still propagate via ? so a DuckDB invalidation triggers in-process recovery (Server: a failed --fast import can invalidate the live DB (fatal index error takes the server down until restart) #82).
  • De-duped against an in-flight sync (and any manual "Sync now") by the job's source param; skipped while a full daily update is running, since that update syncs every enabled feed itself.

Background activity dashboard (frontend)

A header indicator that expands into a panel showing the daemon's whole job pipeline — active job + queue + recent finishes — across all job types (source syncs, the scheduled update, manual maintenance like dedup/index/backup). Running, interruptible jobs can be cancelled. Source cards keep their own inline per-source progress (C1); this is the global view, reading GET /jobs.

Supporting change

JobSnapshot now carries the job's params, so the scheduler can de-dupe by source and the UI can label jobs by what they operate on.

Notes

Relates to #40. Closes #99.

🤖 Generated with Claude Code

…nc (#99)

Two parts of multi-source Phase C3 (#40):

Enable→auto-sync (backend): enabling a source no longer requires "Sync now".
The scheduler's ~60s tick now picks up enabled-but-never-synced sources and
submits a background sources_sync for each — works with the GUI closed.
- sources::auto_sync_candidates = enabled AND last_run IS NULL (+ has a feed
  driver), so a source that synced/failed/was cancelled is excluded (last_run
  set) while one interrupted by a restart resumes (still NULL).
- sources_sync now records its terminal status (ok / error / cancelled) so a
  failed or cancelled sync isn't auto-retried; errors still propagate for the
  #82 recovery path.
- De-duped against an in-flight sync (and any manual "Sync now") via the job's
  source param; skipped entirely while a full daily update is running, since
  that update syncs every enabled feed itself.

Activity dashboard (frontend): a header indicator that expands into a panel
showing the daemon's whole job pipeline — active job, queue, and recent
finishes — across all job types (source syncs, the scheduled update, manual
maintenance). Running interruptible jobs can be cancelled. Source cards keep
their own inline progress (C1); this is the global view, reading GET /jobs.

To support both, JobSnapshot now carries the job's params (so the scheduler can
de-dupe by source and the UI can label jobs by what they touch).

Adds an auto_sync_candidates unit test. cargo test/clippy clean; client builds.

Relates to #40. Closes #99.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018gaUhu1KVkdxAjSJBLgbbk
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.

Multi-source Phase C3: background-activity dashboard + enable→auto-sync

1 participant