Add sync error logging and --rebuild-cache flag#227
Open
Add sync error logging and --rebuild-cache flag#227
Conversation
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>
roborev: Combined Review (
|
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>
roborev: Combined Review (
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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