Commit Graph

5 Commits

Author SHA1 Message Date
sudacode 3d715c8b89 test(launcher): stabilize SSH resolver coverage 2026-07-09 22:39:26 -07:00
sudacode d57eae4863 fix(launcher): resolve remote Bun path for sync 2026-07-09 18:26:24 -07:00
sudacode dfde19cc4d fix(launcher): address sync review feedback 2026-07-09 00:30:43 -07:00
sudacode 58d54311d8 fix(launcher): address code review findings in stats sync
- merge-catalog: stop dropping anilist_id on every new anime insert
  (bun:sqlite .get() returns null, so the old !== undefined guard always
  fired); the guard was dead anyway since a colliding id is caught earlier
- sync-command: throw instead of fail() inside runHostSync so the finally
  block runs and temp dirs holding snapshot data are cleaned up on failure
- ssh: shell-quote the user-supplied --remote-cmd in the probe, and reject
  option-like (-prefixed) SSH hosts that ssh/scp would parse as flags
- sync-db: close the remote handle if opening the local DB throws
- sync-shared: treat EPERM from process.kill(pid, 0) as alive, not dead
- cli-parser: trim the sync host before the mode-exclusivity check
- tests: cover anilist_id preservation, anilist-based anime matching, and
  the SSH host/shell-quote guards
2026-07-08 23:51:46 -07:00
sudacode be31f96f02 feat(launcher): add sync command to merge stats and history between machines over SSH
subminer sync <host> exchanges VACUUM INTO snapshots over ssh/scp and each
side merges the other's data as an insert-only union keyed on session UUIDs,
video keys, series title keys, and word/kanji identity. Lifetime totals and
daily/monthly rollups are applied incrementally so pre-retention history
survives, remote-only historical rollups are copied, and re-syncing is
idempotent. sync --snapshot/--merge expose the underlying steps for manual
transfers; a pid-file/mpv-socket guard refuses to run while SubMiner may be
writing the database and schema-version mismatches abort the merge.
2026-07-08 23:28:10 -07:00