Add sync error logging and --rebuild-cache flag#227
Add sync error logging and --rebuild-cache flag#227
Conversation
roborev: Combined Review (
|
roborev: Combined Review (
|
When GetMessagesRawBatch returns nil for a message (typically a 404 because the message was deleted between listing and fetching), the error count was incremented but no message ID was logged. This made it impossible to diagnose which messages failed to sync. Add Warn-level logging with the message ID in both incremental and full sync paths so failed fetches are visible in logs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The serve command rebuilds the Parquet analytics cache after each sync, but the standalone CLI commands did not. This caused stale search results when syncs were triggered via launchd or manual CLI. Rather than always rebuilding (which couples sync and caching), add an opt-in --rebuild-cache flag that users can enable in their launchd config or scripts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When the flag is set, always run buildCache rather than gating on cacheNeedsBuild. The staleness check is still consulted to decide whether a full rebuild is needed, but the cache build itself runs unconditionally so users can recover from bad-but-undetected cache states. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When the user explicitly requests cache rebuild via --rebuild-cache, failures should cause a non-zero exit so automation can detect them. Previously these were silently downgraded to log warnings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2a9aa80 to
b4d510e
Compare
roborev: Combined Review (
|
Report cache failures independently rather than mixing them into the "account(s) failed to sync" message. Sync failures and cache failures are now distinct error paths with accurate messages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
roborev: Combined Review (
|
|
closing in favor of #241 |
Summary
GetMessagesRawBatchreturns nil (message fetch failed), in both incremental and full sync paths. Previously the error count incremented silently with no indication of which messages were affected.--rebuild-cacheflag tosyncandsync-fullcommands to optionally rebuild the Parquet analytics cache after sync. Theservecommand already does this automatically, but standalone CLI invocations (e.g. via launchd) left the cache stale.Usage:
msgvault sync --rebuild-cacheormsgvault sync-full --rebuild-cache🤖 Generated with Claude Code