Commit Graph

40 Commits

Author SHA1 Message Date
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
Matthieu Gallien
98061f71d9 feat: test to ensure etag constant means no PROPFIND on a folder
should help ensure we send a PROPFIND only when the folder etag changes

if some metadata apparently change, this is not enough to send a
PROPFIND request

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-07-17 08:57:34 +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
dac875ab89 fix(readonly): better handling of ACL on read-only files on windows
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-06-18 12:08:29 +02:00
Matthieu Gallien
e555434e41 fix(readonly): avoid changing permissions when not needed
in FilePermissionsRestore, first checks the folder permissions before
changing them

will avoid useless call changing permissions when not needed

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-06-02 12:14:35 +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
Matthieu Gallien
91c8a12d46 fix(moveToTrash): enable use of move to trash in some automated tests
should improve coverage for move to trash feature to ensure this is
working as expected by users

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-05-22 09:05:32 +02:00
Matthieu Gallien
a0532921ca fix(readonly): apply ACL also to files inside read-only folders
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-05-09 09:43:16 +02:00
Matthieu Gallien
ff3bf03b8d
fix(autotests): do not remove read-only files already removed
the sync engine will remove invalid items inside read-only folders

not needed to remove them in tests and rather checks that they were
indeed removed

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-18 16:32:27 +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
83e9dbb617
fix(read only folder): allow renaming new file inside read-only folders
needed to download a new file inside a read-only folder

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-18 16:32:26 +02:00
Andy Scherzinger
00994aa9e8
docs(reuse): Migrate to SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2025-04-16 15:19:26 +02:00
Matthieu Gallien
98f8ce7a9c
fix: do not interrupt sync when cleaning invalid read-only items
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-14 17:00:55 +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
4923873ac8 ensure folder permissions are read-only when needed
a folder item must be set read-only if files or sub-folders cannot be
created

a folder item must be set read-write in all other situations

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-11-21 12:06:57 +01:00
Matthieu Gallien
a118c0ad1e detect remnants read-only folders to delete: try to delete them
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-09-12 08:40:50 +02:00
Matthieu Gallien
abde33e7e5 add automated test for deletion of child items in read-only folders
should ensure we are able to get files or dolders be deleted by sync
engine within read-only folders

would happen as the result of changes on server side being propagated
locally or when using selective sync

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-08-21 14:38:21 +02:00
Matthieu Gallien
098f4ef164 better automated tests log
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-05-15 15:06:11 +02:00
Matthieu Gallien
7cde0b16e1 catch std::filesystem exceptions in automated tests
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-05-15 15:06:10 +02:00
Matthieu Gallien
96d1fc0720 temporarily ignore failed tests on windows
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-05-15 15:06:10 +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
4844f326c1 newly created folders will be read-only when needed
Close #6296

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-03-12 23:30:02 +01: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
Matthieu Gallien
706d9697d4 ensure we get proper logs for permissions automated tests
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-03-12 23:30:02 +01:00
Dimitri Papadopoulos
09521edbac Fix residual typos found by codespell
Signed-off-by: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>
2023-09-16 20:36:56 +02:00
Matthieu Gallien
505021af03 enable debug log for some automated tests
should help investigate failure for automated tests

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-07-12 13:41:53 +02: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
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
alex-z
01eb050cd8 Do not remove files from a Group folder and its nested folders whe it is renamed or removed while not allowed.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2022-03-09 10:54:39 +02:00
Hannah von Reth
4d615c31da
Rename csync_instructions_e -> SyncInsturctions 2020-12-15 10:59:10 +01:00
Olivier Goffart
83d743b66b
When moving is allowed but deleting is not, do not restore moved items
Issue #7293
2020-12-15 10:59:01 +01:00
Olivier Goffart
390af4d41b
Tests: introduce ItemCompletedSpy to avoid a bit of code duplication 2020-12-15 10:59:00 +01:00
Christian Kamm
e91e1ca78f
Test: Disable local discovery parallelism in permission test
Adding parallelism broke the test because it depended on the order of
discovery.
2020-12-15 10:59:00 +01:00
Christian Kamm
28797baa39
Discovery: If a move is forbidden, restore the source
Previously the source was deleted (or attempted to be deleted), even if
the new location was not acceptable for upload. This could make data
unavilable on the server.

For #7410
2020-12-15 10:58:58 +01:00
Christian Kamm
c9d1037622
Propagation: Fix delete-before-rename bug #7441
By introducing a PropagateRootDirectory job that explicitly
separates the directory deletion jobs from all the other jobs.

Note that this means that if there are errors in subJobs the
dirDeletionJobs won't get executed.
2020-12-15 10:58:58 +01:00
Christian Kamm
9f3578b276
Tests: Fix DB locking issue in permissions test 2020-12-15 10:58:50 +01:00
Christian Kamm
4bd062f5be
OwnSql: Distinguish no-data from error #6677
This could fix a problem where the client incorrectly decides to delete
local data.

Previously any sqlite3_step() return value that wasn't SQLITE_ROW would
be interpreted as "there's no more data here". Thus an sqlite error at a
bad time could cause the remote discovery to fail to read an unchanged
subtree from the database. These files would then be deleted locally.

With this change sqlite errors from sqlite3_step are detected and
logged. For the particular case of SyncJournalDb::getFilesBelowPath()
the error will now be propagated and the sync run will fail instead of
performing spurious deletes.

Note that many other database functions still don't distinguish
not-found from error cases. Most of them won't have as severe effects on
affected sync runs though.
2020-12-15 10:58:43 +01:00
Christian Kamm
be0fa72fcb
RemotePermissions: Fix empty vs null
Fixes two bugs that appeared since the introduction of the struct:
- when reading permissions from the journal, null ("") was read as
  empty-not-null
- when reading permissinos from the server, empty ("") was read as null

Addresses #4608
2020-12-15 10:58:03 +01:00
Olivier Goffart
ac24cdbde6
New Discovery Algo: Permsission check 2020-12-15 10:58:01 +01:00
Olivier Goffart
08e4ba3363
Data-Fingerprint: Fix backup detection when fingerprint is empty
Add a test to test the data fingerprint feature make me realize it was broken.
The code was relying in the distinction between empty and null QByteArray,
but this was a bad idea as this difference is lost when going through QString.
2018-09-10 20:44:03 +02:00