Commit Graph

120 Commits

Author SHA1 Message Date
Hannah von Reth
fbe53308f7 Remove now unneede csync_instruction_str 2020-04-23 11:52:05 +02:00
Hannah von Reth
ac1102070f Merge branch '2.6' 2019-12-06 16:52:12 +01:00
Olivier Goffart
ba99c38d19 Don't show the "All files deleted" popup when unselecting everything with selective sync
Issue #7337
2019-11-18 11:28:47 +01:00
Olivier Goffart
3a56839683 Discovery: Allow more HTTP error code to be treated as ignored dir
The original code from csync was stopping at any error.
But we have been whitelisting soeme http error code one by one
to ignore the directory instead of aborting the sync.
However, as there are more requests to continue the sync in case
of error, just ignore most HTTP errors

Issue #7586
2019-11-18 09:52:09 +01:00
Olivier Goffart
6b361f2cc2 Merge remote-tracking branch 'origin/2.6' 2019-10-31 17:05:42 +01:00
Olivier Goffart
2a434236d1 Discovery: fix TestSyncVirtualFiles::testExtraFilesLocalDehydrated on windows
On windows we do a test to know if we should change the case of the files,
but that conflict with the test that checks if the file was still there
when the filename is actually the same. Which can happen with virtual files
as they have two representation (the one with and without suffix).
2019-10-31 11:56:40 +01:00
Christian Kamm
16a8823e11 Vfs: Lots of tests and corrections for suffix edge cases
Avoid or deal with problems that happen when suffixed files exist on the
server or suffix and non-suffixed files exist locally.

See #7350, #7261.
2019-10-30 14:41:01 +01:00
Olivier Goffart
91d9f9c9e8 Discovery: Attempt to fix issue with windows VFS and new files
(or moved files)
As seen in the log of #7558, a conflict may be issued by mistake.

See investigation in https://github.com/owncloud/client/issues/7558#issuecomment-547385362

This hopefully fix #7558
2019-10-29 17:04:29 +01:00
Olivier Goffart
292e983d7c Merge remote-tracking branch 'origin/2.6' into master 2019-10-14 14:12:03 +02:00
Olivier Goffart
fb84e4c990 When moving is allowed but deleting is not, do not restore moved items
Issue #7293
2019-10-11 13:09:07 +02:00
Olivier Goffart
4eeb6483b5 Merge remote-tracking branch 'origin/2.6' 2019-10-08 11:11:05 +02:00
Olivier Goffart
cc1cb8c78e Fix warning about serverJob not being used
And fix a FIXME in the same time
2019-10-07 14:50:44 +02:00
Christian Kamm
b5250ea611 Merge remote-tracking branch 'origin/2.6' 2019-09-18 09:41:24 +02:00
Christian Kamm
976db2ef84 Test: Disable local discovery parallelism in permission test
Adding parallelism broke the test because it depended on the order of
discovery.
2019-09-16 19:52:19 +02:00
Christian Kamm
3218df49da Discovery: local job shouldn't be parented
Since it'll be deleted by the thread pool.
2019-09-11 15:50:37 +02:00
Christian Kamm
fa49b3d522 Don't store pointer to local job
There were crashes in the QPointer assignment. Possibly the thread pool
is done with the job and deletes it before the assignment is done.
2019-09-11 11:31:30 +02:00
Markus Goetz
e1b31d742c Discovery: List local directories from thread #7456 #7439 2019-09-09 20:41:55 +02:00
Christian Kamm
d3df7532db Discovery: Remove level of indent around moves
No code changes.
2019-09-02 09:58:59 +02:00
Christian Kamm
99fd45051a 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
2019-09-02 09:58:59 +02:00
Hannah von Reth
50c8b7516c Don't use mutable lambdas as they hide where we modify work on a copy 2019-08-22 14:13:55 +02:00
Christian Kamm
4fd9bdc4b4 Vfs: Remove old db record when dehydrating via rename
For #7338
2019-07-25 15:21:54 +02:00
Christian Kamm
db346dfc08 Vfs: Make move detection work with virtual files #7001
Previously a checksum computation could be done on a suffix-placeholder
file, making discovery believe that no move took place.
2019-07-24 16:16:55 +02:00
Christian Kamm
c44ca94e07 Vfs: Add hook to allow update-metadata for unchanged files
Allows winvfs to convert files to placeholders when vfs is enabled. This
is required to mark files as in-sync #7329.
2019-07-24 10:50:39 +02:00
Christian Kamm
6b89747a26 VfsSuffix: Wipe stale pin states #7273
Previously the pin states of deleted files stayed in the 'flags'
database and could be inadvertently reused when a new file with the same
name appeared. Now they are deleted.

To make this work right, the meaning of the 'path' column in the 'flags'
table was changed: Previously it never had the .owncloud file suffix.
Now it's the same as in metadata.path.

This takes the safe parts from #7274 for inclusion in 2.6. The more
elaborate database schema changes (why use 'path' the join the two
tables in the first place?) shall go into master.
2019-06-27 15:57:20 +02:00
Olivier Goffart
cb26f516f7 Discovery: Do not abort the sync in case of error 404 (or 500)
Issue: #7199
2019-06-05 11:09:16 +02:00
Christian Kamm
6a7b138aa6 Discovery: Query data-fingerprint on root item
Previously the property wasn't queried, meaning the fingerprint logic
couldn't get triggered.
2019-04-12 12:18:02 +02:00
Christian Kamm
440c06c54a Discovery: 403 and 503 on root cause error
Previously these result codes during remote discovery of the sync root
would not cause an error and the discovery would get stuck.

Also extends RemoteDiscovery tests to check for errors on the root item.
2019-04-11 13:48:56 +02:00
Christian Kamm
702a494cbb PropagateIgnore: Default to NormalError for INSTRUCTION_ERROR
Previously if one set the instruction to ERROR while forgetting to set
an error status, it'd propagate as FileIgnored. Now the default is
NormalError for INSTRUCTION_ERROR and FileIgnored for
INSTRUCTION_IGNORE.
2019-04-11 13:48:56 +02:00
Christian Kamm
04268becd1 Vfs: Clear up relationship between _type and pin state
The pin state is a per-item attribute that has an effect on _type:
AlwaysLocal dehydrated files will be marked for hydration and OnlineOnly
hydrated files will be marked for dehydration.

Where exactly this effect materializes depends on how the pin states are
stored. If they're stored in the db (suffix) the dbEntry._type is
changed during the discovery.

If the pin state is stored in the filesystem, the localEntry._type must
be adjusted by the plugin's stat callback.

This patch makes pin states behave more consistently between plugins.
Previously with suffix-vfs pin states only had an effect on new remote
files. Now the effect of pinning or unpinning files or directories is as
documented and similar to other plugins.
2019-04-09 12:46:35 +02:00
Christian Kamm
ca003823d5 Detect missing server data during discovery #7112
This has two positive effects:
- We can put the error on the particular file that has missing data
- We can sync all other files
2019-04-09 10:09:56 +02:00
Christian Kamm
83c30f7dc7 Vfs: Better handling and more tests for suffix file renames
Previously removing the vfs suffix of a file always triggered a
conflict. Now it may just cause a file download.

This was done because users expected symmetry in the rename actions and
renaming foo -> foo.owncloud already triggers the "make the file
virtual" action. Now foo.owncloud -> foo triggers the "download the
contents" action.
2019-04-09 10:09:34 +02:00
Christian Kamm
aca19c7a6d Vfs: Hydrating a virtual is SYNC not NEW #7101
Previously it'd be NEW(ItemTypeFile), but now it has changed to be
SYNC(ItemTypeVirtualFileDownload) which allows better classification.
2019-03-28 17:30:28 +01:00
Christian Kamm
b181740b30 VFS: Unbreak behavior for rename+hydrate #7001
Users can rename a file *and* add/remove the vfs suffix at the same time
leading to very complex sync actions. This patch doesn't add support for
them, but adds tests and makes sure these cases do not cause unintened
behavior.

The rename will be propagated, but the users's hydrate/dehydrate request
will be ignored.
2019-03-21 11:13:16 +01:00
Christian Kamm
3d18e52017 Discovery win: Fix detection of case-only renames
Previously they were detected as DELETE+NEW because if "a" is renamed to
"A" then QFile::exists("a") will still return true on Windows.
2019-02-28 08:43:41 +01:00
Christian Kamm
9b7eba0174 Vfs: Make dehydration a SYNC and not a NEW action
That change will be useful for the notifications. Previously the
dehydrated files were reported as "newly downloaded", now they're
reported as "updated".
2019-02-11 13:35:14 +01:00
Christian Kamm
30d7157eb8 Vfs suffix: Fix dehydration creating the wrong db entry 2019-02-11 13:35:14 +01:00
Christian Kamm
210f309e6e PinStates cleanup
- SyncJournalDB functions now behind internalPinStates() to avoid
accidental usage, when nearly everyone should go through Vfs.
- Rename Vfs::getPinState() to Vfs::pinState()
2019-02-11 13:35:14 +01:00
Christian Kamm
010abe4c82 Pin state updates
- unspecified and inherited are different
- move enum to header in common/
- access through Vfs instead of directly in Journal
2019-02-11 13:35:14 +01:00
Christian Kamm
02f0e18913 Discovery: Files can have dehydrate/download actions
This will be used in conjunction with vfs plugins that detect whether a
file has a pending hydration/dehydration through independent means and
communicate that to the discovery through local file type.
2019-02-11 13:35:14 +01:00
Christian Kamm
e0200fbbd2 Discovery: Add signal for silentlyExcluded files
This allows SyncFileStatusTracker to also know about these. After all
its information is used to provide icons for them too.
2019-02-11 13:35:14 +01:00
Olivier Goffart
dfdcd3ff54 Move: Fix move detection in directory move on the other side 2019-01-22 08:14:12 +01:00
Olivier Goffart
303922b80f Move: add more test and fix move within moves 2019-01-22 08:14:12 +01:00
Christian Kamm
90a8eaa949 vfs suffix: Ignore server files or synced files with the suffix #6953 2019-01-18 11:03:01 +01:00
Christian Kamm
df1723c9b2 vfs: Remove newFilesAreVirtual - use root PinState instead
This unifies how to deal with pin states.

Also enable reading a folders direct pin state vs its effective pin
state.
2019-01-07 10:09:03 +01:00
Olivier Goffart
3313de9066 Discovery: Handle the blacklistFiles from the server capabilities
Issue #434

Ideally one could add the blacklist to the exlucde reggexp, but this
is simpler
2018-12-22 18:19:37 +01:00
Christian Kamm
fac6ad354f vfs: Use PinState in sync algorithm #6815
New files are virtual if the file's pin state is OnlineOnly.
2018-12-19 14:04:24 +01:00
Olivier Goffart
3eabe35520 Discovery: Set right direction when restoring deleted discovery because it has modified files
(Catched by a faillure of t1.pl)
2018-12-19 10:54:48 +01:00
Christian Kamm
18ab3f5dcd vfs: Separate vfs availability from new-files-virtual
This helps support 2.5 settings where there are virtual files in the
tree but new files aren't created virtual.

It's also a prelude for #6815

There's currently no way of
- upgrading vfs plugins (a silent suffix->winvfs upgrade is attempted
  once only, when moving to master)
- disabling vfs capabilities outright
2018-11-26 13:02:48 +01:00
Christian Kamm
4f56366fd5 vfs: Ensure SyncOptions::_vfs is never null
- Create a VfsOff derived class
- Make it a shared pointer shared with Folder::_vfs
2018-11-26 13:02:48 +01:00
Christian Kamm
6cb071da47 Generalize Result<> class, add Optional<>
To make it nicer to use outside of HTTP results.
2018-11-26 13:02:48 +01:00