Account removal silently keeps the local sync folder, so re-adding creates ownCloud (2), (3), …
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Read the removal flows in src/gui/accountsgui/accountviewcontroller.cpp and src/gui/FoldersGui/accountfolderscontroller.cpp, then trace teardown through src/gui/accountmanager.cpp and src/gui/folder.cpp. The issue also names src/gui/folderman.cpp for duplicate path selection. Start by reviewing the existing removal dialogs and GUI tests; done means a safe, opt-in folder removal flow with clear handling of existing paths, covered by tests. An open linked pull request is already addressing this issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C++
- Stelle
- 1.5k
- Fork
- 695
- Merge medio
- 8g 7h
- PR unite (30g)
- 6
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di owncloud/client
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
Overlay icons show "sync" instead of the warning (yellow) or error (red) icon for sync errors.Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di owncloud/client
Issue simili
-
needs-format
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Niko1221/Strata#6251 · 1 commento ·
I maintainer di solito rispondono entro 5 giorni
-
[Bug]: NP 管理器文件编辑器里删除键无效Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
metasequoiaime/msime#11666 ·
I maintainer di solito rispondono entro 1 giorno
-
DAE2 crashes on call.without.effects with a non ref.func expressionForse già presa @stevenfontanella l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
WebAssembly/binaryen#9404 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
CodeZombie/goodluckOS#178 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
CVO-Org/immersive-cigs-rewrite#313 ·
I maintainer di solito rispondono entro 1 giorno