Commit graph

16 commits

Author SHA1 Message Date
allexzander
5175d186a4 Do not ignore return values for SyncJournalDB in unit tests.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2022-09-17 09:47:15 +02:00
alex-z
53654b2a50 Allow manual renaming of files and folders with spaces. Allow uploading invalid file name via the InvalidFileName dialog.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2022-05-16 18:07:26 +03:00
Matthieu Gallien
2ea68d75bd add automated tests for LockFileJob to validate proper behavior
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-05-02 13:52:05 +02:00
Matthieu Gallien
dc95f29165 fetch and store in sync database information abot lock state of files
fetch lock properties from server

decode them and store them in sync database

test to ensure we do properly handle those properties

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-05-02 13:52:05 +02:00
Matthieu Gallien
908066072a avoid deleting renamed file with spaces in name
ensure that normal sync engine will nto delete new file renamed due to
trailing/leading spaces in name

rename before upload in the same job to avoid having invalid state in
local desktop client database to ensure any subsequent run of the sync
engine will not make wrong decisions

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-04-06 07:32:02 +00:00
Matthieu Gallien
d4081c99a7 prevent updating files when that would result in invalid mtime
ensure that we never try to sync a file with a sync that would result in
setting it up to an invalid mtime

test a recovery scenario with plain old sync folder and virtual files

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-03-17 23:28:02 +00:00
Matthieu Gallien
541447723a remove all usage of QDateTime::toTime_t() to avoid overflow
QDateTime::toTime_t() can overflow if called with a date outside its
domain of working

this method is obsolete and QDateTime::toSecsSinceEpoch() is the
replacement

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-03-17 23:28:02 +00:00
Matthieu Gallien
d0c2570b04 simplify sync folder in some automated local discovery tests
should be faster and easier to understand

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-02-07 21:32:06 +00:00
Matthieu Gallien
8decd475e5 clean transition when files with spaces exist already
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-02-07 21:32:06 +00:00
Matthieu Gallien
e89268bdd7 ensure we emit a rename command for renamed files
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-02-07 21:32:05 +00:00
Matthieu Gallien
6ceb45bac4 test files that should be renamed in sub-directory
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-12-07 11:35:38 +01:00
Felix Weilbach
df11424596 Trim trailing spaces before uploading files
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-10-14 11:22:59 +00:00
Olivier Goffart
62ec4c9330
Discovery: Handle the blacklistFiles from the server capabilities
Issue #434

Ideally one could add the blacklist to the exlucde reggexp, but this
is simpler
2020-12-15 10:58:30 +01:00
Olivier Goffart
7061f31887
Discovery: Fix downloading files when database is used for local discovery
This also fix the currently failling LockedFilesTest
2020-12-15 10:58:17 +01:00
Olivier Goffart
75f66ddaa1
Local discovery: always recurse within touched directory
If the file system watcher tells us a directory was modified, we should
recurse into it because it means it is probably a new directory

Issue #6804
2020-12-15 10:58:11 +01:00
Christian Kamm
765c12dae1
LocalDiscoveryTracker: Separate from Folder and move to libsync
To allow relevant code to be closer together and for testing in
unittests without having to get a gui Folder.

See #6120
2020-12-15 10:57:51 +01:00