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.93% +0.06%
==========================================
Files 518 518
Lines 48814 48895 +81
==========================================
+ Hits 32157 32240 +83
+ Misses 13890 13885 -5
- Partials 2767 2770 +3 ☔ 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@74b6c942dd9eb866e9ba621928a6d42df87e439e🧩 Skill updatenpx skills add larksuite/cli#feat/drive-push-smart-if-exists -y -g |
f12883b to
a1c22f0
Compare
9770cfd to
9b93fbf
Compare
Add --if-exists=smart to Drive push and pull so repeated folder syncs can skip transfers when modified_time shows the target copy is already up to date. The mode is intentionally best-effort, and the pull path preserves the remote modified_time on downloaded local files to keep repeated smart syncs stable while aligning the implementation, tests, and skill docs with the real Drive metadata contract.
9b93fbf to
74b6c94
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