Home

dev / openkara

publicthedavidweng/OpenKara· sync paused
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

feat(remote): manifest-based pull, GC executor, resumable uploads, range downloads (#151)

2 months ago

10ed49d
Authored
Davy7/21/2026, 1:39:38 AM
Wire the remaining issue #151 gaps:

- Manifest-based pull: revision.rs reads the repository manifest to
  discover the committed generation, downloads the generation-specific
  database from `.openkara/databases/<gen>.sqlite` with size + SHA-256
  verification against the manifest, and advances `committed_generation`
  in the control DB. Legacy repositories (no manifest) fall back to
  pulling `openkara.db` directly.

- GC executor: `execute_gc` picks up pending Gc operation rows and
  deletes database generations older than `committed_generation - 1`.
  The previous generation is retained as a rollback safety net. Skips
  cleanup when the manifest has not yet advanced to the expected
  generation.

- Resumable uploads: Dropbox `resumable_upload_bytes` wires the existing
  upload_session helpers (start/append/finish) with control-DB progress
  persistence. Google Drive wires `google_drive_resumable_upload` with
  session URL persistence. WebDAV `upload_file` now uses staged upload
  (PUT to staging + server-side MOVE) with direct-PUT fallback.

- Range downloads: Dropbox, Google Drive, and WebDAV all implement
  `download_range` using HTTP Range headers, writing bytes at the
  requested offset without truncating the destination file.

- Credential refresh single-flight: process-wide `OnceLock<Mutex<()>>`
  in Dropbox and Google Drive refresh paths ensures concurrent expired
  token requests cause only one network refresh call.

- Cleaned up stale PR#4/PR#5/PR#8 TODO comments now that the features
  are implemented.

Parent65e7802

7 files changed
  • src-tauri/src/remote/atomic_download.rs+54−21
  • src-tauri/src/remote/dropbox.rs+197−17
  • src-tauri/src/remote/executor.rs+362−7
  • src-tauri/src/remote/google_drive.rs+241−14
  • src-tauri/src/remote/recovery.rs+16−15
  • src-tauri/src/remote/sync/revision.rs+51−8
  • src-tauri/src/remote/webdav.rs+197−11