refactor: add ensure_not_started() guard#466
Conversation
Add a state guard that returns an error if a manager's sync has already been started, and use it in `start_sync()` implementations instead of inline state checks.
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughChanges enhance sync error handling by refactoring SyncError::SyncInProgress to carry a ManagerIdentifier and consolidating duplicate inline state guards across multiple sync manager implementations into a centralized ensure_not_started helper function. This improves error specificity and reduces code duplication. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add a state guard that returns an error if a manager's sync has already been started, and use it in
start_sync()implementations instead of inline state checks.Summary by CodeRabbit
Release Notes