Repository navigation
Dbjournal per account - #5045
Conversation
Do not compute on its own any more.
Rely on the name that was passed to csync_init()
That should allow to sync the same local folder to multiple remote destinations. see #3764
The parameter path is not longer needed.
|
@danimo @DeepDiver1975 Where did @mention-bot go? |
|
@dragotin Looks good to me so far! The exclude pattern for the journal file also needs updating. There are a couple of other places that also have the "csync_journal" string (like folderwatcher_linux). |
|
How will this work when the client picks a new sync directory for an unrelated server? |
The sync journal name has a dependency on the remote url now.
It is indeed already handled by csync_exclude.
Before it was in Folder, however, the command line client does not have the Folder class. To not duplicate code, the function to generate the sync journal name went to SyncEngine class.
|
Plus csync test fixes, and adoption to the new cmocka API. |
The filename must not be wiped in csync_commit as that is happening after every sync. It is only set once in the constructor of the SyncEngine in csync_init().
Migration strategy to the new filename.
One local folder can now be configured as sync target for multiple accounts as long as their url and user differ. Also this patch accepts that the sync folder is behind a symlink. Also this patch fixes a bug that before the user input was taken canonically which was not working for the symlink handling.
plus some whitespace changes.
|
@ogoffart @guruz @jturcotte what do you guys think? |
|
Also, it seems that in my tests the big-folder choices got lost and they were displayed as new. Will have to investigate. EDIT: Fixed. There was a bug that wiped all journals on each start. |
|
There's also currently a problem where having two different accounts on the same server will end up with the same sync journal db name, because the credentials are not part of the hash. I wonder whether we have access to the username early enough to make it affect the db name. |
|
@dragotin What's the rationale for deriving the DB name from the url? The main advantage I see over just using a random value is that the same db might be reused even if the settings are lost. And that seems relatively small. If we used a random value we could completely sidestep the question of whether the user is available at that time already. |
|
One complication is owncloudcmd: If we determine the db filename automatically from url, path and username, we can avoid having to pass the db name explicitly. |
|
The main thing that still needs doing (besides more thorough tests!) is to update the manual tests: they still use .csync_journal.db explicitly in a couple of places. |
The added underscore means that older clients will also ignore the file.
* Use 'user' value for journal name generation * Save journal name in settings * Make owncloudcmd choose the right db
a4b36b0 to
49f8143
Compare
|
@ckamm I was not thinking into the direction of using a random name and storing in the settings. Might be a good idea, I am not sure... |
|
@dragotin I've gone with the hash-based approach, because that allows owncloudcmd to determine the right database from the host, folder, username arguments. Otherwise people would have had to pass the db path explicitly to it and we'd have broken all existing uses of owncloudcmd... |
|
@ogoffart This is ready for a final round of review. All looks good from my point of view now. I'll spend time on manual tests and see if I can make anything fail. |
| const QString userDirClean = QDir::cleanPath(path)+'/'; | ||
|
|
||
| // folderDir follows sym links, path not. | ||
| bool differentPathes = !Utility::fileNamesEqual(QDir::cleanPath(folderDir), QDir::cleanPath(path)); |
There was a problem hiding this comment.
should we not canonicalize?
There was a problem hiding this comment.
Utility::fileNamesEqual canonicalizes both arguments. Which makes me wonder why we call cleanPath. Should be no problem to drop that, right?
| Q_OBJECT | ||
| public: | ||
| FolderWizardLocalPath(); | ||
| FolderWizardLocalPath(AccountPtr account); |
|
Actually, -1, because: |
|
Bug:
|
|
@ogoffart Comments addressed. |
|
👍 : |
This patch changes the name of the sync journal. It adds a component that is built from the remote account. That is supposed to fix the root cause of #3764 and makes it possible to sync a local folder to multiple servers.
Note that this is experimental and still lacks these things:
Comments are welcome @ogoffart @danimo @ckamm