100 Commits
Author SHA1 Message Date
Christian KammandMatthieu Gallien ebaa98fa7a owncloudcmd: Use env vars for chunk sizes #7078
Moves a bunch of env var reading from Folder into SyncOptions.
2021-08-23 09:44:34 +02:00
Christian KammandKevin Ottens 4c4cbf0d97 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.
2020-12-15 10:59:02 +01:00
Christian KammandKevin Ottens ee3279c904 Tests: Fail if the initial sync fails 2020-12-15 10:59:01 +01:00
Christian KammandKevin Ottens 9d422284af Discovery: Distinguish readdir and closedir errors 2020-12-15 10:59:01 +01:00
Christian KammandKevin Ottens 89216daee6 Propagate dir: Never write the etag on remote mkdir #7481
It must always only be written once all children are successfully
propagated.
2020-12-15 10:59:00 +01:00
Christian KammandKevin Ottens c9476a11f4 Checksums: Explicitly close file before reporting result
To ensure it's no longer open when the finished signal fires.
2020-12-15 10:59:00 +01:00
Christian KammandKevin Ottens 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 KammandKevin Ottens e596b55977 Discovery: Change local job signal signatures
To make it more explicit that data a copy of the data is transfered
between threads. (though Qt will make a copy of the arguments anyway)
2020-12-15 10:58:59 +01:00
Christian KammandKevin Ottens 71f71b38f1 Discovery: local job shouldn't be parented
Since it'll be deleted by the thread pool.
2020-12-15 10:58:59 +01:00
Christian KammandKevin Ottens 53a217d4e4 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.
2020-12-15 10:58:59 +01:00
Christian KammandKevin Ottens a5c6612883 ConnectionValidator: increase timeout to 57s #7456
When the gui thread blocks for several seconds it's possible for the
ConnectionValidator to timeout and decide that the account is
unreachable. It will then terminate all sync runs.

Increasing the timeout makes this less likely to happen. The tradeoff is
that real disconnects will not be detected as quickly.

This does not address the root cause but makes the symptom less likely
to appear.
2020-12-15 10:58:59 +01:00
Christian KammandKevin Ottens e37e954720 Discovery: Remove level of indent around moves
No code changes.
2020-12-15 10:58:58 +01:00
Christian KammandKevin Ottens 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 KammandKevin Ottens 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 KammandKevin Ottens 3446412d92 PropagateDownload: Don't try to open readonly temporaries
This situation could arrise when receiving a read-only share and the
temporary rename failed for some reason.

See #7419
2020-12-15 10:58:58 +01:00
Christian KammandKevin Ottens 0ac8a3e6be Don't fatal on "Storage temporarily unavailable"
This is an unreliable workaround. The real fix will need to be deferred
to another release.

For #5088
2020-12-15 10:58:57 +01:00
Christian KammandKevin Ottens bade7aedc6 Checksums: Add back QIODevice api
Because the winvfs plugin needs it. But be more careful about the
device's lifetime this time.
2020-12-15 10:58:55 +01:00
Christian KammandKevin Ottens 18e1098e38 Remove maxLogLines config option
It's no longer used.

For owncloud/docs#1365
2020-12-15 10:58:55 +01:00
Christian KammandKevin Ottens ea829f96ca Download: Don't trigger too many concurrent hash computations
Previously the job would only become "active" when the downloads
started. That meant that arbitrarily many hash computations could be
queued at the same time.

Since the the file was opened during future creation this could lead to
a "too many open files" problem if there were lots of new-new conflicts.

To change this:
- Make PropagateDownload become active when computing a hash
  asynchronously.
- Make the computation future open the file only once it gets run. This
  will make it less likely for this problem to occur even if thousands
  of these futures are queued.

For #7372
2020-12-15 10:58:55 +01:00
Christian KammandKevin Ottens 8a5a185752 Fix 'unused parameter name' warnings 2020-12-15 10:58:55 +01:00
Christian KammandKevin Ottens c9dbe46542 Checksums: Fix crash due to threading issue
The checksum computation thread was potentially using a QFile that was
deleted in the gui thread.

For #7368
2020-12-15 10:58:54 +01:00
Christian KammandKevin Ottens a587cd3a13 AccountSettings: Fetch subitems after wiping them
That helps avoid empty lists after account creation #7336
2020-12-15 10:58:54 +01:00
Christian KammandKevin Ottens 5761f4cd8a SyncEngine: Don't duplicate fatal errors
Previously fatal error texts were duplicated: Once they entered the
SyncResult via the SyncFileItem and once via syncError().

syncError is intended for folder-wide sync issues that are not pinned
to particular files. Thus that duplicated path is removed.

For #5088
2020-12-15 10:58:54 +01:00
Christian KammandKevin Ottens 61972c35a8 Discovery: Parse etag to be consistent with RequestEtagJob
This avoids unnecessary sync runs.

For #7345
2020-12-15 10:58:54 +01:00
Christian KammandKevin Ottens 38c466efbf Vfs: Require local discovery after disabling vfs
Without it local files aren't guaranteed to be downloaded #6936.
2020-12-15 10:58:54 +01:00
Christian KammandKevin Ottens 55ee3f440b Vfs: Remove old db record when dehydrating via rename
For #7338
2020-12-15 10:58:54 +01:00
Christian KammandKevin Ottens e6990bd04e 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.
2020-12-15 10:58:54 +01:00
Christian KammandKevin Ottens 00dcf3ef59 Vfs: Ensure pins change with (de-)hydration
Previously an implicit hydration of a file in an online-only folder
would not change the pin state and cause a dehydration on the next
sync.
2020-12-15 10:58:53 +01:00
Christian KammandKevin Ottens 0df3b83bd2 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.
2020-12-15 10:58:53 +01:00
Christian KammandKevin Ottens b34df4413b Vfs: Improve strings for availability states 2020-12-15 10:58:53 +01:00
Christian KammandKevin Ottens 5bc2180478 Vfs: Preserve pin state on hydration
For #7322 and #7323
2020-12-15 10:58:53 +01:00
Christian KammandKevin Ottens fc52c5d0cd Vfs: Retain existing data when enabling vfs #7302
Previously all local data was deleted because the root folder was marked
as OnlineOnly.
2020-12-15 10:58:53 +01:00
Christian KammandKevin Ottens eb58352286 Vfs: Make test pass with different suffix #7279 2020-12-15 10:58:52 +01:00
Christian KammandKevin Ottens 5acb157a7e 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.
2020-12-15 10:58:52 +01:00
Christian KammandKevin Ottens 0e9f030b0f RequestEtagJob: Consistently parse etags #7271
Previously RequestEtagJob did return the etag verbatim (including extra
quotes) while the db had the parsed form. That caused the etag
comparison during discovery move detection to always fail. The test
didn't catch it because the etags there didn't have quotes.

Now:
- RequestEtagJob will parse the etag, leading to a consistent format
- Tests have etags with quotes, detecting the problem
2020-12-15 10:58:52 +01:00
Christian KammandKevin Ottens 69fa1e4775 UploadDevice: Fix windows issues #7264
- Close the UploadDevice to close the QFile after the PUT job is done.
  This allows winvfs to get an oplock on the file later.

- Don't rely on QFile::fileName() to be valid after
  openAndSeekFileSharedRead() was called. The way it is openend on
  Windows makes it have an empty filename.
2020-12-15 10:58:52 +01:00
Christian KammandKevin Ottens fb47419e84 Vfs: Move pin state if files move #7250
Previously renames of items didn't carry the pin state with them.
2020-12-15 10:58:52 +01:00
Christian KammandKevin Ottens 34dc5e4e88 Vfs: Don't let new local files start out unpinned #7250
If one adds a new file to an online-only folder the previous behavior
was to upload the file in one sync and dehydrate it in the next. Now
these new files get set to Unspecified pin state, making them retain
their data.
2020-12-15 10:58:52 +01:00
Christian KammandKevin Ottens 452ed56571 Upload: Read file chunks gradually #7226
Instead of all at once, to reduce peak memory use.

Changing UploadDevice in this way requires keeping the file open for the
duration of the upload. It also means changes to open(), seek(), close()
to ensure that uses of the device work right when a request needs to
be resent.
2020-12-15 10:58:51 +01:00
Christian KammandKevin Ottens a7852e3aba Http2: Resend requests on ContentReSend error #7174
Since Qt does not yet transparently resend HTTP2 requests in some cases
we do it manually.

The test showed a problem where the initial non-200 reply would close
the target temporary file and the follow-up request couldn't store any
data. Removing that close() call is safe because there also is a
_saveBodyToFile flag that guards writes to the target file.
2020-12-15 10:58:51 +01:00
Christian KammandKevin Ottens ee1078b768 owncloudcmd: log sync errors
Previously it was hard to debug some errors since the messages would not
show up in the output.
2020-12-15 10:58:50 +01:00
Christian KammandKevin Ottens b974f579ae Chunked upload: Fix percent encoding in If header #7176 2020-12-15 10:58:50 +01:00
Christian KammandKevin Ottens 9f3578b276 Tests: Fix DB locking issue in permissions test 2020-12-15 10:58:50 +01:00
Christian KammandKevin Ottens a0457d5e1d Tests: fix vfs availability test case 2020-12-15 10:58:50 +01:00
Christian KammandKevin Ottens edad7ce7d7 Vfs: Mark sqlite temporaries excluded on db-open #7141
The previous patch ensured that the sqlite temporaries weren't deleted
and recreated for every sync run, but there was still time between
client startup and the first sync run where they would have the
"needs-sync" icon.
2020-12-15 10:58:50 +01:00
Christian KammandKevin Ottens 7774b8049e Vfs: Distinguish availability error kinds #7143
Previously "no-availability" meant db-error and querying the
availability of a nonexistant path returned AllHydrated.

Now, the availability has a DbError and a NoSuchItem error case.
2020-12-15 10:58:49 +01:00
Christian KammandKevin Ottens 1e5ae77994 Fix logic for duration that an etag reply indicates connectivity
This got inverted accidentally when std::chrono was introduced.

For #7160
2020-12-15 10:58:49 +01:00
Christian KammandKevin Ottens 7f3f13fd97 Vfs: "free space" only shows when it has an effect #7143
To do this, introduce AllDehydrated availability and rename
SomeDehydrated to Mixed - it now guarantees there are also hydrated
items.
2020-12-15 10:58:49 +01:00
Christian KammandKevin Ottens 40d9fc4f4b Vfs: Adjust and centralise action text #7143
Saying "Currently available locally" sounds more like an indicator than
"Availably locally" does. Centralizing translations avoids consistency
issues between shell context menus and sync folder context menu.
2020-12-15 10:58:49 +01:00
Christian KammandKevin Ottens 021f994584 FolderWizard: Don't crash when typing invalid drive #7041
When the user typed "x:" where the drive x didn't exist, the validation
function would loop forever. Now it shows a "path doesn't exist" error.
2020-12-15 10:58:49 +01:00
Christian KammandKevin Ottens 21cb93e3ce SyncEngine: Don't close db when done #7141
The db-close operation is likely a leftover from when the SyncEngine
owned its own db connection and serves no purpose anymore.

Closing the db causes the removal of the temporary wal and shm files.
These files are recreated when the db is opened again, which happens
almost immediately.

This is a problem for winvfs because the delete-recreate step wipes the
exclusion state on these files just after the sync is done. That meant
that the db temporaries permanently had a "needs sync" icon marker shown
in the explorer.

Avoiding reopening the db also reduces the number of log messages per
sync.
2020-12-15 10:58:48 +01:00
Christian KammandKevin Ottens a4f357ee4b Sqlite: Use FULL synchronous mode with non-WAL journal
According to the documentation DELETE+NORMAL isn't safe from corruption
on older file systems.
2020-12-15 10:58:48 +01:00
Christian KammandKevin Ottens 076e24f465 Log: Start logging immediately when "permanent logs" enabled #7146
Previously one would need to wait for the next sync run to create the
first log file.
2020-12-15 10:58:48 +01:00
Christian KammandKevin Ottens 772a210cc9 Mention selective sync when switching on vfs 2020-12-15 10:58:48 +01:00
Christian KammandKevin Ottens cfbcdc01db Discovery: Improvements to doc comments 2020-12-15 10:58:48 +01:00
Christian KammandKevin Ottens fbe2dbf4ab Discovery: Query data-fingerprint on root item
Previously the property wasn't queried, meaning the fingerprint logic
couldn't get triggered.
2020-12-15 10:58:48 +01:00
Christian KammandKevin Ottens c50f041c5b 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.
2020-12-15 10:58:48 +01:00
Christian KammandKevin Ottens 7b96321df2 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.
2020-12-15 10:58:47 +01:00
Christian KammandKevin Ottens da40e84aec About: Add remark about vfs plugin that's in use #7137 2020-12-15 10:58:47 +01:00
Christian KammandKevin Ottens 2bffde2600 Fix windows build 2020-12-15 10:58:47 +01:00
Christian KammandKevin Ottens 22234e0e73 LogWindow: Remove output, add "go to log folder" button #6475 2020-12-15 10:58:47 +01:00
Christian KammandKevin Ottens dcf34316fd Vfs: Add 'availability', a simplified, user-facing pin state #7111
The idea is that the user's question is "is this folder's data available
offline?" and not "does this folder have AlwaysLocal pin state?".
The the answers to the two questions can differ: an always-local
folder can have subitems that are not always-local and are dehydrated.

The new availability enum intends to describe the answer to the user's
actual question and can be derived from pin states. If pin states aren't
stored in the database the way of calculating availability will depend
on the vfs plugin.
2020-12-15 10:58:47 +01:00
Christian KammandKevin Ottens 590db28541 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.
2020-12-15 10:58:46 +01:00
Christian KammandKevin Ottens 2738f110f2 Sqlite: Update to 3.27.2 2020-12-15 10:58:46 +01:00
Christian KammandKevin Ottens cd10e3d28c PropagateDirectory: Set initial dir mtime to server mtime #7119
It's still not synced in any way later.
2020-12-15 10:58:46 +01:00
Christian KammandKevin Ottens 69887c531e PropagateDirectory: Remove dead code
1. The _firstJob is usually deleted by the time the PropagateDirectory
   finishes. (deleteLater() is called early)
2. The PropagateDirectory::_item and PropagateRemoteMkdir::_item point
   to the same SyncFileItem anyway. This code is a leftover from when
   each job had its own instance.
2020-12-15 10:58:46 +01:00
Christian KammandKevin Ottens fd9b01981b 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
2020-12-15 10:58:46 +01:00
Christian KammandKevin Ottens 4bab93b246 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.
2020-12-15 10:58:46 +01:00
Christian KammandKevin Ottens 5e5b0b3f76 Vfs suffix: Require suffix when creating placeholder files 2020-12-15 10:58:45 +01:00
Christian KammandKevin Ottens 3f55f9302e 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.
2020-12-15 10:58:45 +01:00
Christian KammandKevin Ottens e0c8acc195 Notifications: Don't say "downloaded" for new files #7101
These files may very well just be new virtual files that were explicitly
*not* downloaded.
2020-12-15 10:58:45 +01:00
Christian KammandKevin Ottens 0c0049c908 Local discovery tracking: On success, also wipe _renameTarget
It's possible that the rename target was in the local discovery list.
2020-12-15 10:58:45 +01:00
Christian KammandKevin Ottens 04e0e22513 Protocol, Notifications: Show destination() instead of _file
destination() now consistently points to the file after the successful
sync operation. _file might be the place the item was moved from.
2020-12-15 10:58:45 +01:00
Christian KammandKevin Ottens 47f10fbf96 Fix and test _file and _renameTarget
There was a bunch of inconsistency around whether _file was set to
_renameTarget or not. This is now never done, passing on more
information.
2020-12-15 10:58:44 +01:00
Christian KammandKevin Ottens 0cf19123a7 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.
2020-12-15 10:58:44 +01:00
Christian KammandKevin Ottens d496aa5933 Linux: Add autostart delay to avoid tray issues #6518
It seems that sometimes the tray implementation isn't ready on system
startup. Retrying later seems to not help. Delaying the start of the
client is the workaround that people have reported as effective.
2020-12-15 10:58:43 +01:00
Christian KammandKevin Ottens 2f7cdb81cf Tray: Try to establish tray after 10s if failed initially #6518
When owncloud is started during desktop startup the tray may not yet
be running when the client starts. This will make the client attempt
to create a tray icon again after 10 seconds if there's no tray
during initial startup.
2020-12-15 10:58:43 +01:00
Christian KammandKevin Ottens 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 KammandKevin Ottens ee6a48b3dc Client certs: Store pkcs12 in config, password in keychain
It still reads and writes the old format too, but all newly stored
client certs will be in the new form.

For #6776 because Windows limits credential data to 512 bytes in older
versions.
2020-12-15 10:58:43 +01:00
Christian KammandKevin Ottens cc840534c0 Add PLUGINDIR cmake setting and define #7027
By default, plugins are only searched next to the binary or next to the
other Qt plugins. This optional build variable allows another path to be
configured.

The idea is that on linux the oC packaging probably wants the binary in
something like /opt/owncloud/bin and the plugins in
/opt/owncloud/lib/plugins.

Similarly, distribution packagers probably don't want the plugins next
to the binary or next to the other Qt plugins. This flag allows them to
configure another path that the executable will look in.
2020-12-15 10:58:43 +01:00
Christian KammandKevin Ottens 575935ded0 Windows: Forbid chars 0-31 in filenames #6987 2020-12-15 10:58:42 +01:00
Christian KammandKevin Ottens a72bf89779 Selective sync: Don't collapse tree when entering mode #7055
doExpand() is called when the selective sync editing mode is enabled in
the folder settings view. Previously it'd set the expansion to be
exactly the root items. Now, it just expands any root items that are
currently collapsed, leaving all other item expansion unchanged.
2020-12-15 10:58:42 +01:00
Christian KammandKevin Ottens 2e11f14a6b SocketApi: Fix crash with readyRead() after disconnected() #7044
With the recent bugfix to avoid sending messages on dead connections
0bfe7ac250c54f5415c0a794c7b271428e83c3cf
the client now crashed if readyRead() was received after disconnected()
for the socket as the listener for that connection was already removed.

This code fixes it by still invoking the handler from readyRead() but
passing a SocketListener that won't attempt to send messages.
2020-12-15 10:58:42 +01:00
Christian KammandKevin Ottens 6199e140a5 Wizard: Avoid cert dialog multiple connection
This could lead to odd behavior when slotCertificateAccepted
was called multiple times.
2020-12-15 10:58:42 +01:00
Christian KammandKevin Ottens 83268c255a Folder wizard: Fix infinite loop for bad paths #7041 2020-12-15 10:58:42 +01:00
Christian KammandKevin Ottens 93afc2a04b 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.
2020-12-15 10:58:42 +01:00
Christian KammandKevin Ottens 238ac53666 Ensure local discovery on selective sync changes
As far as I'm aware local discovery can be skipped on folders that are
selective-sync blacklisted, so a local discovery is required when an
entry is removed from the blacklist.

Also rename
avoidReadFromDbOnNextSync() -> schedulePathForRemoteDiscovery()
since the old name might also imply it's not read from db in the local
discovery - which is not the case. Use Folder::
schedulePathForLocalDiscovery() for that.
2020-12-15 10:58:41 +01:00
Christian KammandKevin Ottens 4c04351360 Fix warnings about signedness
Sizes are always qint64, not unsigned.
TransferIds are always uint.
2020-12-15 10:58:41 +01:00
Christian KammandKevin Ottens 60cb5d3b34 Tests: Fix permission propagation check
It was using the wrong path to the conflict file.
2020-12-15 10:58:41 +01:00
Christian KammandKevin Ottens 5089f55629 Test: Add check for permission propagation
Also covering propagation to the downloaded file when a conflict-rename
is done at the same time, which used to not work.
2020-12-15 10:58:41 +01:00
Christian KammandKevin Ottens aed1f28980 Tests: Add db checks to rename/move tests
For moves it's relevant that the old db entry is removed and the new one
is created at the right location.
2020-12-15 10:58:41 +01:00
Christian KammandKevin Ottens 910ccaf600 Vfs: Improve sync protocol entries for actions
Creating a new virtual file and replacing a file with a virtual one now
have their own text in the protocol, not just "Downloaded".

To do this, the SyncFileItem type is kept as
ItemTypeVirtualFileDehydration for these actions. Added new code to
ensure the type isn't written to the database.

While looking at this, I've also added documentation on SyncFileItem's
_file, _renameTarget, _originalFile and destination() because some of
the semantics weren't clear.
2020-12-15 10:58:41 +01:00
Christian KammandKevin Ottens f24687ec93 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".
2020-12-15 10:58:40 +01:00
Christian KammandKevin Ottens 797734870f PropagateDownload: Create conflict even if local file changed
Fixes a bug introduced while moving the attribute propagation before the
conflict-renaming.
2020-12-15 10:58:40 +01:00
Christian KammandKevin Ottens 8a8e93827f Vfs suffix: Fix dehydration creating the wrong db entry 2020-12-15 10:58:40 +01:00
Christian KammandKevin Ottens b06f67baf0 Vfs: Ensure VfsOff works without start() being called
In tests an un-started Vfs instance is sometimes passed to SyncEngine
via SyncOptions.
2020-12-15 10:58:40 +01:00
Christian KammandKevin Ottens 6a977edeee Vfs: Remove VfsDefaults
That just complicated things. It's ok if Vfs is not a fully abstract
interface class.

The pinstate-in-db methods are instead provided directly on Vfs and
VfsSuffix and VfsOff use them to implement pin states.

The start() method is simply non-virtual and calls into startImpl() for
the plugin-specific startup code.
2020-12-15 10:58:40 +01:00
Christian KammandKevin Ottens e9cbe13598 Vfs: Add option to hide socketapi pin actions
Because some plugins provide alternative ui.
2020-12-15 10:58:40 +01:00
Christian KammandKevin Ottens e6ee5d0f8a PropagateDownload: Conflict-rename later
The block of code that propagated attributes etc from the previously
existing file was placed *after* the block that renamed the previously
existing file to a conflict name. That meant the propagation didn't work
in the conflict case.
2020-12-15 10:58:39 +01:00
Christian KammandKevin Ottens 6c5fa1dadd Vfs: dehydration is separate action
Allows for better attribute preservation.

Also add verifyFileUnchanged() call before dehydration to avoid data
loss when discovery takes a while.
2020-12-15 10:58:39 +01:00