Commit Graph

89 Commits

Author SHA1 Message Date
Matthieu Gallien
1b6c2e6805 fix(vfs/cfapi): skip inserting new placeholder items with invalid mtime
filter new placeholder items by invalid modtime and only proceed with
creating only the valid ones

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-08-29 14:07:27 +02:00
Matthieu Gallien
8351bb56f5 feat(vfs/windows): use a single call to CfCreatePlaceholders for all
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-08-29 14:07:27 +02:00
Jyrki Gadinger
684e29e18c fix(cfapi): check for valid ProcessInfo in cfApiFetchDataCallback
This shouldn't happen, but just in case it does it'll avoid another
crash.

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-08-14 15:01:10 +02:00
Jyrki Gadinger
102e4447f8 fix(cfapi): only log process info if it's present
Some callbacks do not contain a valid value for the `ProcessInfo` member
despite `CF_CONNECT_FLAG_REQUIRE_PROCESS_INFO` being set.

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-08-14 15:01:10 +02:00
Jyrki Gadinger
1e68f383b1 fix(cfapi): set up connections before requesting hydration
The `hydrationRequestReady` signal could be emitted before it was
connected to the event loop, resulting in the data transfer never being
started.

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-08-14 13:21:20 +02:00
Hannah von Reth
8de85cbb24 Reduce warning about empty path
Signed-off-by: Hannah von Reth <h.vonreth@opencloud.eu>
2025-07-29 12:55:16 +02:00
Hannah von Reth
b24ea4acf9 Fix dehydration
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Signed-off-by: Hannah von Reth <h.vonreth@opencloud.eu>
2025-07-29 12:55:16 +02:00
Hannah von Reth
a2fed5b08a Initilize structs
Signed-off-by: Hannah von Reth <h.vonreth@opencloud.eu>
2025-07-29 12:55:16 +02:00
Hannah von Reth
cfbc1e8703 Only disconnect if connected
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Signed-off-by: Hannah von Reth <h.vonreth@opencloud.eu>
2025-07-29 12:55:16 +02:00
Hannah von Reth
4d2966771d Fix CF_PLACEHOLDER_BASIC_INFO.FileIdentity
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Signed-off-by: Hannah von Reth <h.vonreth@opencloud.eu>
2025-07-29 12:55:16 +02:00
Camila Ayres
ec74f8d274
fix(folder): rename VFS folders using same pattern of sync folders.
- Migrate vfs mode from config and load cfapi plugin for the folder.
- Move rename logic to Utility class.

Signed-off-by: Camila Ayres <hello@camilasan.com>
2025-07-28 15:23:25 +02:00
Matthieu Gallien
9712fe221c
fix: use proper categorized logging
Co-authored-by: Jyrki Gadinger <nilsding@nilsding.org>
Signed-off-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
2025-07-16 17:40:44 +02:00
Matthieu Gallien
ffc5d7653f
fix: use proper categorized logging
Co-authored-by: Jyrki Gadinger <nilsding@nilsding.org>
Signed-off-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
2025-07-16 17:40:34 +02:00
Rello
2492c0548a
fix: Add consistent logging to CFAPI callbacks
Signed-off-by: Rello <Rello@users.noreply.github.com>
2025-07-16 17:39:20 +02:00
Rello
b2d9086a50
Merge branch 'nextcloud:master' into master 2025-06-23 18:17:27 +02:00
Matthieu Gallien
99d4f16435 fix(windows/virtualFiles): prevent implicit hydration at API level
use the dedicated flag from CfApi to prevent self implicit hydration
requests

should ensure even more reliable handling of virtual files

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-06-07 18:08:39 +02:00
Matthieu Gallien
1ecab229d6 fix(warning): avoid compilation warning by specifying type
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-06-06 11:57:27 +02:00
Matthieu Gallien
c837e1c010 fix(tests): will currently detect wrong attempts to access deleted files
with virtual files we may wrongly try to access a file we just deleted

in which case an assert should ensure we capture this during automated
tests

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-06-05 14:01:38 +02:00
Matthieu Gallien
d082f839d0 fix(logs): make one log message useful
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-06-05 14:01:38 +02:00
Rello
1ec8fe63ac Change qCDebug error logs to qCWarning 2025-06-05 09:24:32 +02:00
Andy Scherzinger
130668c3b9
docs(reuse): Migrate to SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2025-04-29 09:00:19 +02:00
Integral
356e4f9296 refactor: replace QString() with QStringLiteral() for better performance
Signed-off-by: Integral <integral@member.fsf.org>
2025-01-31 15:11:02 +01:00
Matthieu Gallien
5d2ee18886 remove deprecated API
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-12-16 16:15:40 +01:00
Matthieu Gallien
321c583b69 allow dehydrating pinned LNK files
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-12-16 16:15:40 +01:00
Matthieu Gallien
ae0203c462 dehydrate placeholder files using CfDehydratePlaceholder
might be enough to get this working reliably

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-12-11 14:47:00 +01:00
Matthieu Gallien
d705cad6b9
improve logs for CfAPI handle requests in erroneous cases
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-11-22 09:50:09 +01:00
Matthieu Gallien
caf1d492b1
provide proper log when we block a self hydration request
should make the existing log more useful when tracking the
self requested implicit hydration bugs

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-11-22 09:50:08 +01:00
alex-z
f70d1c1079
Support Windows .lnk files with VFS Cf API.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2024-07-10 10:29:21 +02:00
Camila Ayres
c8175721ee
Remove unecessary call to sendTransferInfo.
Possible fix for #6876.

Signed-off-by: Camila Ayres <hello@camilasan.com>
2024-07-08 12:03:37 +02:00
Matthieu Gallien
c5c8f0f11b avoid deadlock: cancel hydration requests coming from itself
our current infrastructure will cause a deadlock for any hydration
requests coming from desktop files client itself

the main thread is responsible for executing the hydration request but
if the same thread is already blocked waiting for the hydration to
happen, both (open system call and hydration request handling) process
will never be completed and wait for each over in a stuck cycle

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-07-01 16:10:02 +02:00
Matthieu Gallien
79c5791dfe avoid logs too verbose and with binary data
with those logs, hydrating is causing too much log to be written and
after some time (with big fixles), hydration is failing

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-07-01 15:40:24 +02:00
Camila Ayres
bba5097227 Print desktop client process id.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2024-06-28 09:12:29 +02:00
Camila Ayres
60d6cb47b1 Add new cfapi callbacks for logging.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2024-06-28 09:12:29 +02:00
Camila Ayres
340956ebfe Add more logs to track file hydration.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2024-06-28 09:12:29 +02:00
Matthieu Gallien
a357570633 fix compilation after rebase
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-04-26 09:05:12 +02:00
Matthieu Gallien
bebb8e1954 fix compilation issues on windows
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-04-26 09:05:12 +02:00
Matthieu Gallien
1522d01d5b if a virtual file change but bothing changed: set it as in sync
some software (at least outlook native software) may fiddle with CfApi
placeholder metadta and set a .msg file to be out of sync state when
opening it

in that case, we will let the sync engine go over it and decide what to
do

it is then possible in that case that we would just put it back in "in
sync" state

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-04-23 18:04:35 +02:00
alex-z
74bef928a3 VFS. CfAPI. Provide detailed error message for leading '#' placeholder update failure.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2024-02-22 16:56:15 +01:00
Matthieu Gallien
bf78f008bd
extend log to get information about mtime modifications by the client
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-12-06 10:42:33 +01:00
Matthieu Gallien
b77fc9d4ff
avoid modifying a placeholder (virtual files) when not needed
acoid modifying some metadata of the placeholder when this placeholder
has just been uploaded to the server (will avoid truncating the
timestamps)

Close #6190

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-12-06 10:13:49 +01:00
alex-z
cc99b0ae45 Remove unused function 'revertPlaceholder'.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2023-09-14 16:00:14 +02: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
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
Dries Mys
76376aa052 Set VFS PinState to Excluded for ignored files.
Setting PinState to Excluded ensures the syncing icon is not shown for ignored items.
If the PinState is not set to Excluded, also all parent directories are shown as being synced, which is very inconvenient for the end user as it seems that some folder are never fully synced by Nextcloud which isn't the case.
As long as .lnk files are not converted to placeholder files, also set them to Excluded to hide the syncing icon.

Closes #5524
Closes #5594

Co-authored-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
Signed-off-by: Dries Mys <dries.mys@my-dreams.be>
2023-07-20 13:44:55 +02:00
Matthieu Gallien
6b18fd9d69
declare ErrorCategory enum class and declare its metatype
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-06-07 12:48:20 +02:00
Matthieu Gallien
41dc09b9a2 with cfapi when dehydrating files add missing flag
CF_UPDATE_FLAG_DEHYDRATE is apparently needed to get dehydration to
always succeed

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-02-28 13:27:52 +01:00
allexzander
289a641d74 VFS Windows: Display the sharing state and lock state in the 'Status' column of Windows Explorer
Signed-off-by: allexzander <blackslayer4@gmail.com>
2022-10-04 18:32:51 +02:00
James Horsley
1d7a2c06f6 Fix crash in cldapi.dll
Fixes #3349

Change placeholder functions to take QStrings instead of handles

Signed-off-by: James Horsley <jbhorsley@gmail.com>
2022-09-05 09:16:19 +02: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