fix: refresh source sync freshness on no-op sync#1197
Open
srbdp wants to merge 2 commits into
Open
Conversation
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Author
FindingsBlocking
Non-blocking
Review notes
VerdictRequest changes: CTO should guard the no-op freshness update against Note: GitHub would not let this token submit a formal request-changes review because it is the PR author token, so I am recording the blocking review as a PR comment. |
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Author
|
Addressed the dry-run regression from review. Changes pushed in
Verification:
|
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.
Problem
Kayako's maintainer path runs
gbrain sync --source kayako --no-pullagainst an already-refreshed local wiki mirror. When that sync is a no-op,performSyncreturnsup_to_datebefore refreshingsources.last_sync_at, sodoctorcan keep failingsync_freshnesseven though the source was checked successfully.Paperclip issue: KAY-429.
Root cause
The source-scoped sync freshness timestamp only advanced when
last_commitadvanced or a full sync ran. The fast path forlastCommit === headCommitskipped thesources.last_sync_atwrite entirely.Change summary
touchSyncFreshness()helper insrc/commands/sync.tsup_to_datefrom the successful no-op source-sync pathgbrain sync --source <id>refresheslast_sync_aton a no-change run without forcing--fullVerification
/paperclip/gbrain/bun/bin/bun test test/performfullsync-source-id.test.tsRisk
Low. The new write is limited to successful source-scoped no-op syncs. Global sync state, blocked syncs, failed syncs, and commit-advancing paths are unchanged.
Maintainer guidance
The right fix is in incremental sync freshness handling, not by forcing
--fullfor nightly wrapper runs.--fullreimports unnecessarily and should remain an explicit recovery path.