-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Journal: Don't use a ._ path if it won't work #5633 #5844
Conversation
When synchronizing a folder on a samba share, creating files that begin with ._ is often forbidden. This prevented the client from creating its ._sync_abcdef.db file. Now, it'll check whether the preferred filename is creatable, and if it isn't it'll use .sync_abcdef.db instead. The disadvantage is that this alternative path won't be ignored by older clients - that was the reason for the ._ prefix.
@SamuAlfageme I haven't actually tested this yet! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good!
To make it even more clear, can you also add the new pattern to https://github.com/owncloud/client/blob/2.3.2/sync-exclude.lst#L9 ? Then users will see it in their UI too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree with @guruz about adding it in the exclude list. This would have a negative effect on performence.
} | ||
|
||
// Neither worked, just keep the original and throw errors later | ||
qDebug() << "Could not find a writable database path" << file.fileName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qCWarning please
QFile file2(QDir(localPath).filePath(alternateJournalPath)); | ||
if (file2.open(QIODevice::ReadWrite)) { | ||
// The alternative worked, use it | ||
qDebug() << "Using alternate database path" << alternateJournalPath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qCInfo
The ignore patterns for the journal files are hardcoded. Add them to the UI to make them discoverable.
@SamuAlfageme Tested now. To me it looks like
Can be merged into 2.3 once we have approval from Samu and either guruz or ogoffart. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ckamm just went over the same scenarios and got the same results. Nice!
Only comment I have
I thought [the journal] was going to be recreated while running [with the "Unable to find sync journal] or forcing sync but didn't happen until I restarted [the client] (maybe we could do it on the fly? - like it happens when deleting the journal on a normal local sync folder -)
👍
@SamuAlfageme I'm glad your tests worked out. Doing the check and migration of journal on loading of settings seems sufficent to me - cases where ._ files become suddenly unavailable while the client is running sound vanishingly rare. |
@@ -48,6 +48,9 @@ IgnoreListEditor::IgnoreListEditor(QWidget *parent) : | |||
"and cannot be modified in this view.") | |||
.arg(QDir::toNativeSeparators(cfgFile.excludeFile(ConfigFile::SystemScope))); | |||
|
|||
addPattern(".csync_journal.db*", /*deletable=*/false, /*readonly=*/true); | |||
addPattern("._sync_*.db*", /*deletable=*/false, /*readonly=*/true); | |||
addPattern(".sync_*.db*", /*deletable=*/false, /*readonly=*/true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
When synchronizing a folder on a samba share, creating files that begin
with ._ is often forbidden. This prevented the client from creating
its ._sync_abcdef.db file.
Now, it'll check whether the preferred filename is creatable, and if
it isn't it'll use .sync_abcdef.db instead.
The disadvantage is that this alternative path won't be ignored by
older clients - that was the reason for the ._ prefix.