nextcloud / desktop

💻 Desktop sync client for Nextcloud
https://nextcloud.com/install/#install-clients
GNU General Public License v2.0
3.04k stars 799 forks source link

[Bug]: False warning of duplicate sync connection with parent or child #7005

Open viharm opened 2 months ago

viharm commented 2 months ago

⚠️ Before submitting, please verify the following: ⚠️

Bug description

When creating a new sync connection, the Select a remote destination folder pop-up throws a false warning that the requested folder is either a parent or a child of another folder. image

Steps to reproduce

  1. Add a connection to a path on the server that includes a keyword in the last stub of the path, e.g., /home/user/Nextcloud_Test.
  2. then add another connection on the server that has the exact keyword as the last stub of the path, e.g., /home/user/Nextcloud.

Expected behavior

The client should should not emit a warning

Which files are affected by this bug

Not sure

Operating system

Windows

Which version of the operating system you are running.

Windows 11

Package

Other

Nextcloud Server version

28.0.8

Nextcloud Desktop Client version

3.13.2

Is this bug present after an update or on a fresh install?

Fresh desktop client install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

Are you using an external user-backend?

Nextcloud Server logs

No response

Additional info

The destination path on the server is mapped to a SSH storage backend.

joshtrichards commented 2 months ago

I guess we need to add a trailing slash to dir for the startsWith() check:

https://github.com/nextcloud/desktop/blob/14a5dd14f67b6a54a9ed15eb5da04f6dc1beb966/src/gui/folderwizard.cpp#L485-L512