Problem
setInterval callback doesn't await handleSyncIndex().
Current Behavior
// sync.ts:136-139
const syncInterval = setInterval(() => {
console.log('[SYNC-DEBUG] Executing scheduled periodic sync');
this.handleSyncIndex(); // Not awaited!
}, 5 * 60 * 1000);
Impact
If sync takes >5 minutes, next interval fires while previous still running. The isSyncing flag helps but doesn't prevent queueing.
Expected Behavior
Either:
- Await completion before scheduling next
- Use setTimeout recursively instead of setInterval
- Skip interval if previous sync still running
Location
packages/mcp/src/sync.ts:136-139