Skip to content

dropbox: decode received shared-file names - fixes #9707 - #9796

Merged
ncw merged 1 commit into
rclone:masterfrom
sk-sanjay01:fix-9707-dropbox-shared-file-encoding
Aug 25, 2026
Merged

ncw merged 1 commit into
rclone:masterfrom
sk-sanjay01:fix-9707-dropbox-shared-file-encoding

Conversation

@sk-sanjay01

@sk-sanjay01 sk-sanjay01 commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

What does this change do?

listSharedFolders decodes shared-folder names with f.opt.Enc.ToStandardName
before returning them, but listReceivedFiles (which lists files individually
shared with the user, not folders) stored the raw name from the Dropbox API
unchanged. A file whose real name needs backend-specific encoding - e.g. a
trailing space, which Dropbox itself rejects, so rclone's EncodeRightSpace
option stores it as name␠ - was shown under that raw encoded form instead
of being decoded back to the standard name, and findSharedFile could not
resolve such a file when a caller looked it up by its standard name, since it
compares against the raw stored name.

This applies the same ToStandardName conversion listSharedFolders already
uses, so received-file names go through the same decoding as every other
listing path in this backend.

Was the change discussed in an issue or in the forum before?

Fixes #9707, opened by the reporter, who traced the inconsistency to these
exact two functions and the missing conversion. Not yet acknowledged by a
maintainer, so please treat the approach as up for discussion - it is a
one-line change that mirrors the already-correct sibling function
(listSharedFolders), so I don't expect it to be controversial, but flagging
per the contribution guidelines.

Checklist

  • This change is trivial OR it has been discussed and agreed in the linked issue. (one-line fix mirroring the existing listSharedFolders pattern; issue not yet maintainer-acknowledged)
  • I have read the contribution guidelines.
  • (If I used AI tools to help write this code) I have read and understood the AI-assisted contributions guidance, and I have tested and take ownership of this change myself.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate. (not applicable - internal bug fix, no user-facing option/flag change)
  • All commit messages are in house style.
  • (Backend changes only) test_all passes for this backend and if submitting a new backend can provide a test account for the integration tester. (I do not have a Dropbox account to run the live integration suite. go build ./..., go vet ./..., gofmt, and go test ./backend/dropbox/... are all clean. Added two unit tests that exercise the real listReceivedFiles/findSharedFile code against a mock Dropbox API server standing in for the live API; confirmed both fail without this fix and pass with it. Happy to provide a test account later if a maintainer can help verify against the live API in the meantime.)
  • This Pull Request is ready for review.

@sk-sanjay01
sk-sanjay01 requested a review from ncw as a code owner August 21, 2026 07:15
listSharedFolders already decoded shared-folder names with
f.opt.Enc.ToStandardName, but listReceivedFiles stored the raw name
returned by the Dropbox API unchanged. Names that require encoding
(e.g. a trailing space, which Dropbox itself rejects, so rclone
stores it as "name␠" via EncodeRightSpace) were therefore shown under
their raw, encoded form for received files instead of being decoded
back to the standard name, and findSharedFile could not resolve such
a file by its standard name.

Apply the same ToStandardName conversion listSharedFolders uses.
@sk-sanjay01
sk-sanjay01 force-pushed the fix-9707-dropbox-shared-file-encoding branch from 1932796 to a3538c9 Compare August 24, 2026 05:25

@ncw ncw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a nice fix - thank you :-)

I'll merge when CI goes green

@ncw
ncw merged commit f3a7aaf into rclone:master Aug 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dropbox: received shared-file names bypass standard encoding conversion

2 participants