Skip to content

fix: avoid a double separator in automatic uploads remote path - #5033

Open
RaphaelFakhri wants to merge 2 commits into
owncloud:masterfrom
RaphaelFakhri:fix/automatic_uploads_double_separator
Open

RaphaelFakhri wants to merge 2 commits into
owncloud:masterfrom
RaphaelFakhri:fix/automatic_uploads_double_separator

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

Related Issues

App: Refs #4451

Folders picked as the automatic uploads destination store their remote path with a trailing separator (for example, /Bbbbb/). AutomaticUploadsWorker then appends another separator before the file name, so every picture or video upload targets a path such as /Bbbbb//PXL_20240819_120404334.jpg. That doubled path is stored in the transfers table and sent in the PUT request, as seen in the logs in the issue.

This change composes the remote path through FolderBackUpConfiguration.getRemotePathForFile(), which trims a trailing separator from the upload path before appending the file name. Configurations saved before this change (with or without a trailing separator, and the root folder /) now produce a single separator.

  • Add changelog files for the fixed issues in folder changelog/unreleased. More info here
  • Add feature to Release Notes in ReleaseNotesViewModel.kt creating a new ReleaseNote() with String resources (if required): not required

QA

  • New unit test FolderBackUpConfigurationTest covers upload paths without a trailing separator, with a trailing separator, and the root folder. The last two fail without the fix.
  • ./gradlew detekt :owncloudDomain:testDebugUnitTest :owncloudApp:compileOriginalDebugKotlin passes.
  • Manual check: pick a destination folder for picture uploads, take a picture, and confirm the upload in the uploads list and the server request use /<folder>/<file> with a single separator.

Signed-off-by: Raphael Fakhri <153192858+RaphaelFakhri@users.noreply.github.com>
@RaphaelFakhri
RaphaelFakhri requested a review from a team as a code owner October 24, 2026 20:08
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Signed-off-by: Raphael Fakhri <153192858+RaphaelFakhri@users.noreply.github.com>
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.

2 participants