Commit Graph

77 Commits

Author SHA1 Message Date
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
Matthieu Gallien
2a3059d779 ensure we do properly failed hydration jobs
report status when the job is in error at end of hydration request
instead of doing the opposite

properly set status in db when a file failed to hydrate (still a virtual
file not a real one)

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-04-03 16:12:42 +02:00
Matthieu Gallien
20a4ed6e7e use proper API to dehydrate a placeholder file
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2022-01-24 14:16:40 +00:00
rakekniven
961cea92ca l10n: Fixed grammar
Reported at Transifex.

Signed-off-by: rakekniven <2069590+rakekniven@users.noreply.github.com>
2022-01-12 15:55:56 +01:00
alex-z
1244e96681 Enforce VFS. Disable 'Make always available locally'.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2021-12-14 15:03:57 +02:00
Matthieu Gallien
b1977dfb18 prevent injecting invalid modified time through CfApi calls
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-12-08 07:22:24 +00:00
Matthieu Gallien
c53159cb0c fix random error when updating CfApi metadata
initialiazing all fields in a structure is required to not have random
behavior

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-11-29 18:04:00 +01:00
Matthieu Gallien
83a8058b51 improve logging for CfApi
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-11-23 13:41:29 +00:00
Matthieu Gallien
a3013de6ea fix OCC::CfApiWrapper::handleForPath when path does not exist
sometime it can be called with a path that is already deleted

ensure we always go to the correct code path

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-11-23 13:41:29 +00:00
Matthieu Gallien
9eed62a854 remove too noisy log print
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-11-23 13:41:29 +00:00
Matthieu Gallien
43ec429fe4 improve logs when place holder info cannot be read
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-11-04 15:02:27 +01:00
Dmytro Korchynskyi
608fc5fb3a Fixed warnings by using static_cast
Signed-off-by: Dmytro Korchynskyi <kdl.dima@gmail.com>
2021-09-13 13:05:41 +03:00
Matthieu Gallien
8ad6f89fed bring back dynamic load of VFS plugins
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-07-08 08:11:17 +00:00