fix: resync clears last_sync_ts; add live doc counts to dashboard
All checks were successful
Deploy / deploy (push) Successful in 14s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-22 20:10:12 +01:00
parent 3e9889ede0
commit cbcf88ca96
4 changed files with 108 additions and 2 deletions

View File

@@ -178,10 +178,13 @@ def unsuspend_replica(replica_id: int, session: Session = Depends(get_session)):
@router.post("/{replica_id}/resync")
async def resync_replica(replica_id: int, session: Session = Depends(get_session)):
"""Phase 3: wipe sync_map and trigger full resync."""
"""Wipe sync_map, reset last_sync_ts, and trigger a full resync."""
replica = session.get(Replica, replica_id)
if not replica:
raise HTTPException(404)
# Reset last_sync_ts so the sync fetches ALL master documents
replica.last_sync_ts = None
session.add(replica)
# Delete all sync_map entries for this replica
entries = session.exec(
select(SyncMap).where(SyncMap.replica_id == replica_id)