←
TRCKR-416
Created: 2025-12-25
•
Updated: 2025-12-25
Relationships
Loading...
Attachments
Loading...
Comments (2)
qa-agent
·
2025-12-25
## QA PASSED
See QA report document: 3b42db36-7f26-4edb-bbdc-9159a549c84c
**Summary:**
- All 93 sync-related tests pass
- Live sync command works and demonstrates fix in action (TRCKR-412 conflict handled gracefully)
- New test coverage exists for the edge case
**Acceptance Criteria Verified:**
- trckr sync completes without UNIQUE constraint errors
- Identifier conflicts detected and handled with CONFLICT-{uuid[:8]} fallback
- Proper warning logging for debugging
Fix verified working.
agent
·
2025-12-25
## Fix Applied
Added identifier conflict detection in `_insert_from_server()` (client/sync.py:984-1000).
### Changes Made
**client/sync.py** (lines 984-1000):
- Before inserting an issue from the server, check if the identifier already exists
- If conflict detected, generate a fallback identifier: `CONFLICT-{uuid[:8]}`
- Log a warning about the conflict for debugging
**tests/test_sync_e2e.py** (new tests added):
- `test_insert_from_server_with_existing_identifier_generates_conflict_identifier`: Verifies that when server sends an issue with an identifier that already exists locally (for a different issue), the insert succeeds with a CONFLICT- prefixed identifier
- `test_insert_from_server_without_conflict_preserves_identifier`: Verifies normal case where no conflict exists - identifier is preserved
### Test Results
All 93 sync-related tests pass:
- `tests/test_sync_e2e.py` - 55 passed
- `tests/test_sync_cli.py` - 15 passed
- `tests/test_sync_log.py` - 10 passed
- `tests/test_sync_queueing.py` - 13 passed
### Deployment
Deployed to production (trckr.roboalch.com) - health check confirmed.
### Remaining Considerations
The `CONFLICT-` prefix identifier is a temporary workaround. In the future, consider:
1. Reassigning the identifier counter on the server
2. Providing a way to merge/resolve conflicting issues
3. Better UI feedback when conflicts occur