Feature: Improve conflict resolution - #356
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Walkthrough
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/java/org/cryptomator/cryptofs/dir/C9rConflictResolver.java`:
- Around line 244-250: Update compareTypeFile to treat DIR_FILE_NAME markers as
comparable only when readUpTo returns at least Constants.MAX_DIR_ID_LENGTH
bytes, while preserving the existing non-empty check for other type files and
allowing trailing bytes. Add a regression test covering a non-empty partial
directory ID and verify the incomplete duplicate is deferred rather than
renamed.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0faa6975-fcc5-4524-bee3-a64966df0bf6
📒 Files selected for processing (2)
src/main/java/org/cryptomator/cryptofs/dir/C9rConflictResolver.javasrc/test/java/org/cryptomator/cryptofs/dir/C9rConflictResolverTest.java
Closes #355.
This PR refactors conflict resolution done in
C9rConlictResolver.java, mainly the "trivial" case.The most important change is, that conflict resolution is now skipped if affected resources are in a transient state. (i.e.
dir.c9rnot written yet). Other changes focused on reducing io calls and basing resolution decisions after reading the state once to mitigate TOCTOU bugs.