←
TRCKR-835
Created: 2026-01-03
•
Updated: 2026-01-03
Relationships
Loading...
Attachments
Loading...
Comments (1)
agent
·
2026-01-03
## Fix Applied
**Root Cause:**
The `sync configure` command saved the sync configuration but did not trigger an initial sync. Since `last_sync_version` is initialized to 0 for new clients, the first `sync()` call would correctly pull a full snapshot - but users had to manually run `trckr sync` after `sync configure`.
**Changes Made:**
1. **trckr.py:425-475** - Modified `sync_configure` command to:
- Automatically trigger `engine.sync()` after configuration succeeds
- Handle sync errors gracefully (AuthError, NetworkError, SyncError)
- Added `--no-sync` flag to skip initial sync when not needed
- Display progress: "Performing initial sync..." and "Downloaded N entities"
2. **tests/test_sync_cli.py** - Updated tests:
- Added `--no-sync` to tests that don't need network calls
- Added new test `test_configure_triggers_initial_sync` to verify sync is attempted
- Updated 4 existing tests to use `--no-sync` flag
**Verification:**
- All 10 sync CLI tests pass
- Initial sync triggers automatically after configure
- Network/auth errors are handled gracefully with helpful retry messages
**Usage:**
```bash
# New behavior - full sync happens automatically
trckr sync configure --server-url https://trckr.example.com --api-key sk-xxx
# Skip initial sync if needed
trckr sync configure --server-url https://trckr.example.com --api-key sk-xxx --no-sync
```