Repository navigation
Description
Problem
Removing an account (or a folder sync connection) never offers to delete the
local sync folder. The client only shows a fixed note saying files are kept,
and the folder is left on disk. Because the wizard then re-uses ~/ownCloud
and appends a number whenever that path already exists, every
remove-and-re-add cycle creates a new folder:
C:\Users\<user>\ownCloud
C:\Users\<user>\ownCloud (2)
C:\Users\<user>\ownCloud (3)
...
There is no way to tell the client "also delete the local folder", and no hint
that the leftover folder is what causes the numbered duplicates. Users are
surprised by the ever-growing pile of folders.
Steps to reproduce
- Add an account with default settings (local folder
~/ownCloud). - Remove the account ("Remove connection").
- Add an account again with default settings.
- Observe the new local folder is
~/ownCloud (2), then(3),(4)… on
each repetition.
Why this happens
AccountViewController::onDeleteAccount()(src/gui/accountsgui/accountviewcontroller.cpp)
andAccountFoldersController::onRemoveSync()(src/gui/FoldersGui/accountfolderscontroller.cpp)
show only a Yes/No confirmation with a fixed note:
Note: This will not delete any files.There is no "delete local files"
option.AccountManager::deleteAccount()(src/gui/accountmanager.cpp) only calls
Utility::unmarkDirectoryAsSyncRoot(defaultSyncRoot())(removes the NTFS
ADS tags), andFolder::wipeForRemoval()(src/gui/folder.cpp) removes only
the state DB (.sync_*.db) and temporaries. User files/folders are never
touched.- On re-add,
FolderMan::findGoodPathForNewSyncFolder()(src/gui/folderman.cpp)
starts from~/ownCloudand, whileQFileInfo::exists(folder)is true,
appends" (2)"," (3)", … up to" (100)". So the leftover folder
directly causes the numbered duplicate.
A secondary, harder-to-recover variant: if the hidden .sync_*.db is left
behind (e.g. the connection was removed while a sync was running), the folder
is later rejected as "used in a folder sync connection"
(FolderManagementUtils::numberOfSyncJournals() and
FolderMan::checkPathForSyncRootMarkingRecursive()), so the user cannot even
re-select it manually.
Proposed solution
Add an opt-in "also delete the local folder" choice to the two removal
confirmations, defaulting to the current safe behaviour (keep files):
- In the confirmation dialogs, add a checkbox such as
Delete the local folder "<path>"(unchecked by default), shown only when
the folder exists and is empty of non-synced data, or always shown with a
clear warning. - On removal, if the user checked it, delete the local folder after the
account/folder teardown, preferring the OS trash over a permanent delete
(QFile::moveToTrashon Qt 5.15+, orFileSystem::removeRecursively),
so the action stays recoverable. - Independently of the checkbox, consider reusing an existing, unmarked
~/ownCloudfolder instead of always appending a number, or at least
telling the user why(2)was chosen.
Alternative solutions considered
- Only improve the wording (e.g. "the folder
~/ownCloudis kept; remove it
yourself to reuse the name"). Minimal, but still leaves users with
accumulating folders. - Only auto-reuse the existing folder without an option to delete. Avoids the
duplicate names but removes the safety net entirely. - Document the behaviour only. Does not fix the confusing UX.
Additional context
- Reproduced on the current Windows client.
- Relevant code:
src/gui/accountsgui/accountviewcontroller.cpp,
src/gui/FoldersGui/accountfolderscontroller.cpp,
src/gui/accountmanager.cpp,src/gui/folder.cpp,src/gui/folderman.cpp. - The existing GUI tests (
test/gui/tst_removeAccountConnection) assert only
that the account disappears from the UI, not the dialog text, so adding a
checkbox there should not break them.
This issue was created by an AI agent (OpenHands) on behalf of a user.
Activity