feat(drive): add modified-time smart sync mode#859
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a ChangesSmart --if-exists implementation for Drive push/pull
Sequence Diagram(s)The diagrams embedded in the hidden review stack artifact visualize the timestamp parsing flow and the smart skip decision sequences for pull and push. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #859 +/- ##
==========================================
+ Coverage 65.87% 65.95% +0.07%
==========================================
Files 518 518
Lines 48814 48901 +87
==========================================
+ Hits 32157 32252 +95
+ Misses 13890 13881 -9
- Partials 2767 2768 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@82b41b41fc04d13c3ccde374ea17ab9b966a6b15🧩 Skill updatenpx skills add larksuite/cli#feat/drive-push-smart-if-exists -y -g |
f12883b to
a1c22f0
Compare
9770cfd to
9b93fbf
Compare
9b93fbf to
74b6c94
Compare
74b6c94 to
3f4e468
Compare
Handle mixed-unit duplicate timestamps consistently, avoid turning mtime preservation notices into pull failures, clarify smart push caveats, and align the implementation with lint and docstring coverage checks while keeping the PR as a single commit.
3f4e468 to
82b41b4
Compare
Summary
This PR implements the first roadmap feature point for Drive sync efficiency by adding a new
smartmode for the existing--if-existspolicy.--if-exists=smartis a best-effort incremental optimization based onmodified_time, not a content-hash equality check. It skips redundant transfers when timestamps already show the target side is up to date, and falls back to the safe transfer path when the metadata cannot be trusted.Changes
smartas a new--if-existsmode fordrive +pushand skip uploads when Drivemodified_timealready matches or is newer than the local file mtime.smartas a new--if-existsmode fordrive +pulland skip downloads when the local file mtime already matches or is newer than Drivemodified_time.modified_timeon downloaded local files so repeateddrive +pull --if-exists=smartruns stay stable.smartis accepted by bothdrive +pushanddrive +pull.Design Notes
smartis intentionally a best-effort optimization, not a strict content-equality guarantee.modified_timeon downloaded local files to keep repeated smart syncs stable.modified_timeremains server-controlled, so the CLI can only compare against it, not rewrite it.Test Plan
Related Issues