Commit Graph

68 Commits

Author SHA1 Message Date
Jyrki Gadinger
01526c34e5 fix(quota): parse quota values from servers as double
The server can respond with values like `2.58440798353E+12` instead of
a plain number like `2584407983530`.
`QVariant::toLongLong` does not recognise that as a valid number and
returns `0` instead, breaking the sync for some.

Also added a fallback value in case parsing the value as double doesn't
work either.

Fixes #8555

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-10-16 09:13:03 +02:00
Matthieu Gallien
491e7cd55c chore: fix all occurence of range-loop-detach clazy warning
see https://github.com/KDE/clazy/blob/master/docs/checks/README-range-loop-detach.md

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-10-07 08:51:02 +02:00
Jyrki Gadinger
17a6d5b714 fix(test): manually keep track of the canonical local path of tempDir
Some tests (okay, just the RemoteWipeTest) check for the removal of the
local directory.  However, QFileInfo will return `/` as the canonical
file path if the directory no longer exists, breaking some asserts ...

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-09-25 09:49:53 +02:00
Jyrki Gadinger
fffa90d0aa fix(test): return the canonical file path of the temp dir
Something changed in the file system layer between Qt 6.8 and Qt 6.9
that now results in temporary paths no longer be canonical by default
(i.e. `/private/var/folders/...` changed to `/var/folders/...`, which
confuses the unit tests).

See also: https://bugreports.qt.io/browse/QTBUG-140151

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-09-25 09:49:53 +02:00
Matthieu Gallien
5842f880f7 fix: rename enum FileInfo::Etags to get a more unique name
rename FileInfo::Etags to FileInfo::EtagsAction to avoid any future
possibility that we would want to use this name for something else

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-08-01 11:25:36 +02:00
Camila Ayres
9257c1eb54 test(syncengine): add enum for Etags Validate/Invalidate.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2025-08-01 11:25:36 +02:00
Camila Ayres
4ad69d5945 refactor(quota): rename Quota struct to FolderQuota.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2025-08-01 11:25:36 +02:00
Camila Ayres
ebee194e91 test(syncenginetestutils): add function helper to set FileInfo::FileInfoQuota quota.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2025-08-01 11:25:36 +02:00
Matthieu Gallien
d9bc9a3d95 fix(permissions): fix decoding share-attributes property
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-07-01 14:27:59 +02:00
Matthieu Gallien
4fcf31cb0b fix(permissions): decode share "no download" permission
ensure we use currently existing server API to get the "no download"
permission

requires parsing some share-attributes new DAV property

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-07-01 14:27:59 +02:00
Matthieu Gallien
9ab875af0d fix(permissions): handle properly CanRead permission from server
if Readable permissions is missing, do nto try to download the file

if a file was downlaoded but Readable permission is now missing, remove
it

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-05-26 18:45:06 +02:00
Andy Scherzinger
48e53ea216
docs(reuse): Migrate to SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2025-05-07 23:06:34 +02:00
Camila Ayres
8d58bf30e7 test(syncenginetestutils): add quota-available-bytes and quota-used-bytes to dav propfind request.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2025-05-07 19:09:36 +02:00
Matthieu Gallien
aa5eb0e869
fix(permissions): solve issues with file permissions automated tests
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-18 16:32:26 +02:00
Matthieu Gallien
e1a55fae1c with release 32.0.0 md5 custom checksum is removed from bulkupload
makes our fake server require an md5 custom checksum for bulk upload
until version 32.0.0

starting with 32.0.0 this custom checksum must be empty

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-10 10:40:17 +02:00
Matthieu Gallien
9c0382bb0b automated tests of bulk upload needs to check checksums like real
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-10 10:40:17 +02:00
Jyrki Gadinger
17c31fff3a fix: try to correct mtime on upsyncs
Files with a modification time of less than 0 do usually not make sense
(and afaik the server doesn't accept them either).
--> attempt to update the modification time to _Time.now_ while
propagating

side note: I ran into this because KArchive/Ark(?) didn't consider the
extra time attributes on entries for a certain zip file, so it instead
used the standard time value of each zip entry which was set to <= 1980
for files and < 1970 for directories...

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-04-08 23:18:20 +02:00
Matthieu Gallien
a9293fd25b Qt 6.8 requires macSO 12 or higher: no need to compile against older
clean up preprocessor directives for older macOS releases that are not
supported by macOS minimum required release from the Qt 6.8 release we
require

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-07 11:48:17 +02:00
Matthieu Gallien
4b176c21d4 try to enforce the windows compatibility as guessed from server
for now simple rule to guess if the server has windows naming enforced

if windows naming is enforced, we enforce it for new files

if not, we do not care

for now limited to spaces removal

more to come

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-02-19 13:21:45 +01:00
Claudio Cambra
271f2eb9b6 Replace aAsConst with std::as_const in tests
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-12-20 16:26:57 +01:00
Matthieu Gallien
9be169c856 fix regressions in automated tests for bulk upload
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-11-29 09:23:58 +01:00
Matthieu Gallien
71281cbd39 prevent out of bounds access in automated tests
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-11-22 11:14:21 +01:00
Claudio Cambra
ed71524aeb Add setIsLivePhoto method to FileInfo
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-20 14:39:51 +01:00
Claudio Cambra
74651a0ca8 Add isLivePhoto property to FileInfo in syncenginetestutils
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-20 14:39:51 +01:00
Matthieu Gallien
7301ad3356 in automated tests, update modtime when modifying the content of a file
why one would not update the modification time when modifying a remote
file during automated tests

there is no reason to not update the modification time as this is what
is done by the server

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-10-17 09:45:57 +02:00
Matthieu Gallien
670b2ce42f fix automated tests missing toString() convert from QVariant
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-04-26 09:05:12 +02:00
Matthieu Gallien
274d866c19 fix failing automated test that erases invalid iterator
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-04-26 09:05:12 +02:00
Matthieu Gallien
ced85ac287 fix automated tests with network requests
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-04-26 09:05:12 +02:00
alex-z
f490989a1a Fix CI errors.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2024-04-23 12:18:12 +02:00
alex-z
9ae60258e1 Unit tests for diverse conflicts in one folder.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2024-04-23 12:18:12 +02:00
Claudio Cambra
f13a0fc732 Also prevent use of std::filesystem in macOS 10.14
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-03-28 19:11:57 +08:00
Matthieu Gallien
bf7f87492a update automated test to work with read only folders
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-03-12 23:30:02 +01:00
Claudio Cambra
67e6546e1a Add find method to DiskFileModifier class in SyncEngineTestUtils
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-08-07 16:25:19 +08:00
Claudio Cambra
4cdf525df2
Report size for directories in syncenginetestutils propfind response
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-08-04 17:40:43 +08:00
Claudio Cambra
21656cce17
Replace all manual isntancesof adding trailing slash with use of utility method
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-08-04 17:40:42 +08:00
Dimitri Papadopoulos
9d830e94f9 Fix typos found by codespell
Signed-off-by: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>
2023-06-21 08:47:13 +02:00
Claudio Cambra
89d7e17674 Add FakePropfindReply that accepts raw QByteArray as payload
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-16 18:23:33 +08:00
alex-z
b6ba1fe0d6 Implement Secure filedrop link share. Move data from 'filedrop' to 'files' when syncing E2EE folders.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2023-03-02 19:29:11 +01:00
Matthieu Gallien
602b8db5e2
handle case clash conflicts in a similar way to content conflicts
introduce a new type of conflict for case clash filename conflicts

add proper handling including a new utility class to solve them and a
new dialog for the user to pick a fix

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-01-25 16:37:35 +01:00
Claudio Cambra
12b2673ac2
Add test for deleting encrypted files
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-01-24 17:00:15 +01:00
Matthieu Gallien
b04128fd34 set mtime when building local sync folder state in automated tests
would allow checking mtime with a correct value instead of having a
default value

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-11-22 15:08:46 +01:00
Matthieu Gallien
b5adbf3ab0 fix instances of: c++11 range-loop might detach Qt container warnings
analyzed via clazy

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-11-18 16:02:21 +01:00
Matthieu Gallien
61c792c6f4
fully qualify types in signals and slots
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-11-15 09:57:54 +01:00
Claudio Cambra
e021f25634
Add a suite of tests for ShareModel
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>

Test ShareModel error handling

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>

Improve testing of user/group shares in ShareModel

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>

Add testing for maximum share expire date enforcement in ShareModel

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2022-10-31 18:06:09 +01:00
Matthieu Gallien
d371855e56 test that files soon to be expired will be synced automatically
try to ensure that we properly sync again files for which lock has
expired

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-10-11 16:01:58 +02:00
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
Matthieu Gallien
8551a14c48 ensure SyncEngine use an initialized instance of SyncOptions
will prevent nextcloudcmd command line client from ignoring the settings
handled by SyncOptions

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-08-08 12:36:37 +03:00
alex-z
001deace2d Implement COM Dll for CfApi shell extensins. Implement Thumbnail Provider.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2022-07-29 19:26:53 +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