fix: display only real sync errors in error count and list
- Added CountErroredChanges() method to count only pending changes with LastError - Previously, error count included all pending changes, not just failed ones - Added /api/sync/info endpoint with proper error count and error list - Added sync info modal to display sync status, error count, and error details - Made sync status indicators clickable to open the modal - Fixed disconnect between "Error count: 4" and "No errors" in the list Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -396,6 +396,13 @@ func (l *LocalDB) CountPendingChangesByType(entityType string) int64 {
|
||||
return count
|
||||
}
|
||||
|
||||
// CountErroredChanges returns the number of pending changes with errors
|
||||
func (l *LocalDB) CountErroredChanges() int64 {
|
||||
var count int64
|
||||
l.db.Model(&PendingChange{}).Where("last_error != ?", "").Count(&count)
|
||||
return count
|
||||
}
|
||||
|
||||
// MarkChangesSynced marks multiple pending changes as synced by deleting them
|
||||
func (l *LocalDB) MarkChangesSynced(ids []int64) error {
|
||||
if len(ids) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user