Repository navigation
dropbox: trim ChangeNotify roots case-insensitively - #9702
Conversation
|
Merged current |
|
Current head |
|
Can you fix the conflicts please and while you are at it, squash into one commit - thanks :-) |
fixes rclone#9692 Dropbox is case insensitive and the path_display it returns in change notifications may not match the case of the configured root. Before this change the root was trimmed with a case sensitive prefix match, so when the cases differed the full path was passed to the ChangeNotify callback and the notification was ignored. This trims the root case insensitively while preserving the display case of the remaining path.
c412cb5 to
9f6dba9
Compare
|
I fixed the merge conflict and squashed the commits - will merge when CI goes green |
What does this change do?
Makes Dropbox ChangeNotify remove the configured remote root without requiring
PathDisplayto use the same casing. The relative suffix still comes from the original display path, so callback paths preserve Dropbox display casing.The prefix matcher advances rune-by-rune and tracks the byte offset in
PathDisplay, which also handles case-fold-equivalent Unicode runes with different UTF-8 lengths. Exact-root events become empty and are skipped, sibling paths are not trimmed, and root remotes continue to remove the leading slash.A fake Dropbox files client drives folder, file, and deleted metadata through the complete ChangeNotify runner.
Validation performed:
/docs/...absolute paths instead of relative pathsKversusKand exact-root casesRCLONE_CONFIG=/notfound go test ./backend/dropbox -run "TestTrimPrefixFold|TestChangeNotifyTrimsRootCaseInsensitively" -count=20RCLONE_CONFIG=/notfound go test -race ./backend/dropbox -count=1go vet ./backend/dropboxgo buildRCLONE_CONFIG=/notfound make quicktestA real Dropbox integration remote was not used.
Linked issue
Fixes #9692
For new or changed backends
This fixes event-path handling in the existing Dropbox backend. The regression uses a fake Dropbox client; real-remote
test_allwas not run.Checklist
test_allpasses for this backend and if submitting a new backend can provide a test account for the integration tester - see CONTRIBUTING.md.