fix: only record sync history when a provider is syncing #63
No reviewers
Labels
No labels
bug
critical
ebook-branch
high
low
main
medium
release-blocker
security
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jfro/fuzzy_catalog!63
Loading…
Reference in a new issue
No description provided.
Delete branch "jtk/sync-history-dupes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
complete_sync/2andfail_sync/2now only change status and add a history entry when the provider's status is:syncing. A repeated or late call (e.g.fail_syncaftercomplete_sync) is ignored with a warning naming the provider and its status, instead of adding a duplicate history entry or flipping a finished sync to:error.All callers (
ExternalLibrarySync,AdminLive) call these afterstart_sync, so normal syncs are unchanged. Adds a test-onlysync_history/0and tests for repeated completes, repeated fails, a late fail after complete, and a second sync after the first finished.Found in Nye's audit of
dae07b9.Fixes #61
Review from Nye (approved) —
5c83ec7The
:syncingguard is placed correctly after the unknown-provider clause. A latefail_syncno longer overwrites:idlewith:error. The 4 tests are deterministic (unique provider, cast→call ordering).:infoor:debugwould do instead of:warning. Optional.