Commit graph

928 commits

Author SHA1 Message Date
Matthieu Gallien
0e4ac85f69 in debug builds, we want immediate log flush and debug output
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-10-16 22:00:00 +02:00
alex-z
1e9fa0a132 Activity list fixes and improvements. Adjusted sorting to show interactive and security activities always on top (after errors). Added button to scroll up when new activity arrives. Improved sync status scrollbar.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2023-09-22 15:28:50 +02:00
Claudio Cambra
6cf04d660b Remove OAuth authentication method as it is now unused
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-09-19 14:58:17 +08:00
Dimitri Papadopoulos
8a73a9a6f5 Fix new typos found by codespell
Signed-off-by: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>
2023-09-17 10:41:38 +02: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
alex-z
d26fc34c5c Tests for placeholder file metadata update.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2023-09-14 16:00:14 +02:00
Claudio Cambra
b642c2e1f6 Add a test for the various ways of setting a date on datefieldbackend
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-09-13 10:15:14 +02:00
Claudio Cambra
e254dfc67b Check that signals were correctly emitted in testDateBoundaries
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-09-13 10:15:14 +02:00
Claudio Cambra
ebc3522e79 Add test for date field backend boundaries
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-09-13 10:15:14 +02:00
Claudio Cambra
a4767a108b Add simple test for basic. default date properties of DateFieldBackend
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-09-13 10:15:14 +02:00
Claudio Cambra
797663eb17 Add date field backend test file
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-09-13 10:15:14 +02:00
alex-z
3815919aa5 Fix a crash when saving the locked Word document file due to unnecessary spam to the lock state change from folder watcher logic.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2023-09-05 15:52:04 +02:00
Claudio Cambra
a0c528a190 Replace comments about relevancy of chunk to propagat v1 with variable name change
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-08-31 15:25:00 +02:00
Claudio Cambra
eb01a57359 Add test for Chunk V2 restrictions in testchunkingng
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-08-31 15:25:00 +02:00
Claudio Cambra
2f5c164534 Enforce Chunk V2 API chunk size limits at the sync options level
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-08-31 15:25:00 +02:00
Claudio Cambra
189bc67a0a Fix chunk numbering in chunking tests
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-08-31 15:25:00 +02:00
Matthieu Gallien
aa55275cc8 add an automated test to check that locked files are read-only
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-08-21 12:57:16 +02:00
Matthieu Gallien
ac3fc531ff
test that discovery of file names with UTF-8 is working
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-08-16 10:44:37 +02:00
Claudio Cambra
1cd537f928 Add test for unmodified local files not getting mtimes changed upon upload to server
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-08-07 16:25:19 +08: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
5db79261f6
Fix breakages in testactivitylistmodel caused by recent activitylistmodel changes
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-08-04 17:44:22 +08:00
Claudio Cambra
0b13be663b
Add test for correct reporting of existing folder overcoming size limit
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-08-04 17:42:35 +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
Dries Mys
fb21eb55cf Alter testUnexpectedNonPlaceholder to better reflect the actual use case
Signed-off-by: Dries Mys <dries.mys@my-dreams.be>
2023-07-26 11:05:50 +02:00
Dries Mys
984d06e82a Convert VFS file to placeholder again if needed
Note that Windows may convert a placeholder file to a regular file when
it is replaced by another file, even if the old and new file (inode,
modified time, file size) are identical.

WIN32_FIND_DATA::dwReserved0 is only initialised in case of
FILE_ATTRIBUTE_REPARSE_POINT is set. This field is not a bit set. Check
corrected to only include all cloud reparse points and not other special
reparse points.

Signed-off-by: Dries Mys <dries.mys@my-dreams.be>
2023-07-26 11:05:50 +02:00
Claudio Cambra
74bdbb4aa1
Use nodiscard in TestingALM
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:42:09 +08:00
Claudio Cambra
de4ae7cb9c
Fix testing of sync result error activities in sorted activity list test
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:40:29 +08:00
Claudio Cambra
68d89216ba
Fix setting of sourcemodel in sorted activity list test
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:40:29 +08:00
Claudio Cambra
af3146da52
Test sorted activity list model sort order
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:40:29 +08:00
Claudio Cambra
6d3bbe828f
Expose max activity data from activity list model in TestingALM
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:40:28 +08:00
Claudio Cambra
b3f209e6fe
Expose max activities in TestingALM
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:40:28 +08:00
Claudio Cambra
26777175b7
Add convenience method in TestingALM to fetch more than maximum activities to be displayed in activitylistmodel
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:40:28 +08:00
Claudio Cambra
b7283fa18c
Clean up declarations in activitylistmodel header, remove unused methods
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:40:28 +08:00
Claudio Cambra
aa00b477c7
Fix fetch handling in TestingALM
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:40:28 +08:00
Claudio Cambra
1585c2e0ae
Expose insert dummy activity method in TestingALM
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:40:28 +08:00
Claudio Cambra
a1111938ad
Add test to check that the sortedactivitylistmodel correctly gets updated when the sourcemodel does
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:40:27 +08:00
Claudio Cambra
bbb0cddd08
Verify sorted model is showing the rows in source activity model
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:40:27 +08:00
Claudio Cambra
8003fcda85
Add SortedActivityListModel test
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:40:27 +08:00
Claudio Cambra
06a42908f7
Move creation of example activities from testactivitylistmodel to activitylistmodeltestutils
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:40:27 +08:00
Claudio Cambra
e42f5cf33e
Move activitylistmodel testing QNAM override to dedicated convenience method in ActivityTestUtils
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:40:27 +08:00
Claudio Cambra
1c16728cb0
Move TestingALM to activitylistmodeltestutils
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:40:27 +08:00
Claudio Cambra
00ac5a4568
Move FakeRemoteActivityStorate to new activitylistmodeltestutils
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-07-25 08:40:26 +08:00
Dries Mys
9256417612 Create placeholder while dehydrating if needed
When replacing an OnlineOnly file by another one, the file maintains it
OnlineOnly pin state, but it is converted to a regular file. So, the
dehydration should convert the regular file to a (dehydrated)
placeholder instead of trying to update the (non-existing) placeholder.

Closes #4274

Signed-off-by: Dries Mys <dries.mys@my-dreams.be>
2023-07-20 15:07:46 +02:00
tomdereub
6aacf4ddac Adapt test 2
Signed-off-by: tomdereub <pbtom@lamonerie.net>
2023-07-18 10:57:17 +02:00
tomdereub
d353f08be2 Adapt test to silent exclusion
Signed-off-by: tomdereub <pbtom@lamonerie.net>
2023-07-18 10:57:17 +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
Matthieu Gallien
cd6ee68fec filter out some errors if they are related to network troubles
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-06-28 11:21:50 +02:00
Matthieu Gallien
69d2b06f3d fix ignored signals due to using old connect syntax
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-06-28 11:21:50 +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
alex-z
7e5031d75d Implemented a class ChecksumCalculator to allow stopping the checksum calculation thread on parent destruction.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2023-06-20 11:44:07 +02:00
alex-z
e6f003b00b Remove stale caseclash conflicts when one of conflicting files has been removed from server
Signed-off-by: alex-z <blackslayer4@gmail.com>
2023-06-15 10:13:22 +02:00
Matthieu Gallien
5372276779 add more metadata to sync errors to allow filtering
in order to be able to filter some errors when showing them into the
main dialog activity list, add some more info about the error to know
the origin (like a network issue or a sync issue)

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-06-07 17:25:44 +02:00
Matthieu Gallien
607d0da672
use a much more compact layout for activities
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-05-17 18:16:10 +02:00
Matthieu Gallien
10f9ef5cd5
to store subjectRichParameters use a QVariantMap that is qml friendly
will make it much easier to access fom qml in order to use the data
inside to improve activity list items

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-05-17 18:16:08 +02:00
Matthieu Gallien
ad868daebe
remove custom property to set a source model in a sort proxy model
custom property for source model is not needed

remove code that is not needed

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-05-17 18:16:08 +02:00
Matthieu Gallien
8faab817a0 improve automated tests
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-05-17 08:43:54 +02:00
Matthieu Gallien
30bba4c906 fix automated tests
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-05-17 08:43:54 +02:00
Matthieu Gallien
280094b220 model: first step
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-05-17 08:43:54 +02:00
Claudio Cambra
ce22c409e1 Test important properties in testfiletagmodel
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-16 18:23:33 +08:00
Claudio Cambra
73b94bcf2f Add test for maxTags in FileTagModel
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-16 18:23:33 +08:00
Claudio Cambra
6c68341422 Add test for tags in filetagmodel
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-16 18:23:33 +08:00
Claudio Cambra
ccb07af56a Provide different propfind replies depending on request props in testfiletagmode
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-16 18:23:33 +08: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
Claudio Cambra
955f4de7d2 Add initial testing setup for file tag model
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-16 18:23:33 +08:00
Camila
d6db8fcbd6 Add a dismiss link for notifications without it.
- Fix for #5606 and #5585.
- That is how it is done in the server and other clients.
- Update tests.

Signed-off-by: Camila <hello@camila.codes>
2023-05-16 11:17:37 +02:00
Matthieu Gallien
7118fc4650 use a better name for encryption status attributes
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-04-12 15:46:51 +02:00
alex-z
31c3aee447 Fix unit tests SecureFileDrop
Signed-off-by: alex-z <blackslayer4@gmail.com>
2023-04-05 12:21:28 +02:00
Matthieu Gallien
8659df2266
prevent downgrading e2ee metadata format after initial migration
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-03-31 17:18:29 +02:00
Matthieu Gallien
7c655cf679
use a getter to query encryption status
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-03-31 17:18:28 +02:00
Matthieu Gallien
20422f0247 when local sync folder is overriden, respect this choice
may lead to inadvertant data loss, not sure if that could be an issue

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-03-31 09:21:48 +02:00
Matthieu Gallien
baf9c8b631 add test for windows CfApi
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-03-08 09:45:09 +01:00
Matthieu Gallien
9afd7265bb add a new automated test for virtual files and data restoration
add a test that will try to upload pure virtual files becase restoration
after server data fingerprint has changed

this is illegal and should not happen

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-03-08 09:45:09 +01:00
alex-z
31de652d9b Display 'Search globally' as the last sharees list element
Signed-off-by: alex-z <blackslayer4@gmail.com>
2023-03-03 18:01:05 +01: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
01ecb639ab use new connect syntax
mainly done using clazy and old-style-connect check

close #5426

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-02-28 09:36:27 +01:00
alex-z
5574ddb744 Always discover blacklisted folders locally, to avoid data loss of non-uploaded files when modifying selectivesync list.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2023-02-23 10:58:57 +01:00
Matthieu Gallien
151d17aed4
fix ignored return values in windows specific code
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-02-22 16:50:21 +01:00
Matthieu Gallien
5b2a691f4c
use of QStringLiteral() is invalid: QString() must be used
fix windows specific code compilation warnings

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-02-22 16:50:20 +01:00
Matthieu Gallien
c0549c5c03
fix issues reported by compiling windows code with clang-tidy
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-02-22 16:50:20 +01:00
Matthieu Gallien
76e88572d6
more fixes for attributes without init value
done with clang-tidy

run-clang-tidy -p build -header-filter='.*' -config="{Checks: '*', CheckOptions: [{key: UseAssignment, value: true}]}" -checks='-*,cppcoreguidelines-pro-type-member-init' -fix

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-02-06 10:43:05 +01:00
Matthieu Gallien
b4a8981c03
initialize all variables
done with clang-tidy

run-clang-tidy -p build -config="{Checks: '*', CheckOptions: [{key: UseAssignment, value: true}]}" -checks='-*,cppcoreguidelines-init-variables' -fix

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-02-06 10:43:04 +01:00
Matthieu Gallien
d2f5c6a5c7
initialize many attributes that could have been left without init value
done with clang-tidy

run-clang-tidy -p build -config="{Checks: '*', CheckOptions: [{key: UseAssignment, value: true}]}" -checks='-*,cppcoreguidelines-pro-type-member-init' -fix

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-02-06 10:43:04 +01:00
Camila
b4882ae5c7 Update tests for ActivityData.
Signed-off-by: Camila <hello@camila.codes>
2023-01-27 12:30:01 +00: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
e993684775
Remove faulty else statement from TestFolderman that would erroneously cause failure
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-01-24 17:00:16 +01:00
Claudio Cambra
352c660363
Ensure mocked database entries are correct in TestFolderMan
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-01-24 17:00:16 +01:00
Claudio Cambra
b7311278a8
Fix folderman delete encrypted files test
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-01-24 17:00:16 +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
Claudio Cambra
c59ab85e22
Make accountstate fakeable for tests
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-01-24 17:00:14 +01:00
alex-z
50ffc7373f Update file's metadata in the local database when the etag changes while file remains unchanged. Fix subsequent conflict when locking and unlocking.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2022-12-30 16:57:32 +01:00
alex-z
089b677633 Fix SyncEngineTest failure when localstate is destroyed.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2022-12-15 10:32:10 +01:00
Claudio Cambra
294ec8a2b6
Fix bad remote path in sharetestutils fakefolder, which led to failed FakePropfindReply being provided in tests
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2022-12-13 17:40:16 +01:00
Claudio Cambra
9b5be727b1
Incorporate internal link share into tests
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2022-12-13 17:33:38 +01:00
Christian Göttsche
1a83894074 Fix typo
Found by Lintian.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2022-12-13 09:22:58 +01:00
Matthieu Gallien
af49e1079a fix test and code to not stop on case clash errors
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-11-30 11:49:35 +01:00
Matthieu Gallien
b68754827c case clash should not prevent full propagation
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-11-30 11:49:35 +01:00
alex-z
16153b33b7 Fix CfApiShellExtensionsIPCTest.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2022-11-25 15:03:24 +01:00
Matthieu Gallien
04b4354535 fix include style to always use "" for files from the project
the use of #include <> is only for system headers and not headers from
the project

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-11-25 09:07:02 +01:00
Matthieu Gallien
e7605d505d avoid modifying real configuration file: use temp folder
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-11-25 09:07:02 +01:00