Skip to content

Implement incremental sync with change tracking for Bushel #137

@leogdion

Description

@leogdion

Overview

Add --incremental flag to sync only new/changed data instead of creating duplicates on every sync.

Current Behavior

  • Every sync creates new CloudKit records
  • No detection of existing records
  • Results in duplicate data after multiple syncs

Proposed Enhancement

Features

  • --incremental flag for sync command
  • Last sync timestamp tracking (stored locally)
  • Query existing CloudKit records before sync
  • Compare local data with CloudKit data
  • Only upload new/changed records

Implementation Steps

  1. Add timestamp storage (.bushel-last-sync or similar)
  2. Implement CloudKit query for existing records
  3. Add comparison logic (by version+build number)
  4. Filter out unchanged records before batch upload
  5. Update timestamp after successful sync

Benefits

  • Reduces unnecessary CloudKit operations
  • Prevents duplicate records
  • Faster sync times after initial sync
  • More production-ready workflow

Example Usage

# First sync - uploads everything
bushel-images sync

# Subsequent syncs - only new data
bushel-images sync --incremental

Notes

  • This is mentioned in README limitations section
  • Would significantly improve user experience
  • Important for production usage

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions