Commit Graph

1611 Commits

Author SHA1 Message Date
Hannah von Reth
ed0f10f2b6 Print critical and fatal messages to stderr
That way we might get a reason why the client crashes (dev setup)
2019-08-14 09:07:03 +02:00
Christian Kamm
98c04e1b92 Remove maxLogLines config option
It's no longer used.

For owncloud/docs#1365
2019-08-13 13:24:16 +02:00
Christian Kamm
224129957b 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
2019-08-12 12:27:59 +02:00
Christian Kamm
b7ab14db72 Fix 'unused parameter name' warnings 2019-08-12 08:08:26 +02:00
Christian Kamm
907945d869 LogDir: Compress last logfile on restart
For #7353
2019-08-01 10:12:50 +02:00
Christian Kamm
b3a3f17d74 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
2019-07-31 09:02:02 +02:00
Christian Kamm
23f005e60d Discovery: Parse etag to be consistent with RequestEtagJob
This avoids unnecessary sync runs.

For #7345
2019-07-31 09:01:41 +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
d09c4fd2e8 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.
2019-07-24 16:16:39 +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
199163187a Vfs: Preserve pin state on hydration
For #7322 and #7323
2019-07-18 20:00:28 +02:00
Dominik Schmidt
3e4b3928c2 Add missing OWNCLOUDSYNC_EXPORT 2019-06-28 17:27:33 +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
Christian Kamm
86b15ffb20 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
2019-06-27 13:08:18 +02:00
Christian Kamm
b99c08904e 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.
2019-06-23 10:31:50 +02:00
Christian Kamm
02a9b16b0f Vfs: Move pin state if files move #7250
Previously renames of items didn't carry the pin state with them.
2019-06-23 10:23:37 +02:00
Christian Kamm
e653924e06 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.
2019-06-23 10:23:37 +02:00
Christian Kamm
561460bff7 Shell extension: Show "show versions" only when available #7196
- Don't show it for directories.
- Don't show it when versioning is disabled.
2019-06-16 12:09:52 +02:00
Christian Kamm
86d36f0a78 Merge remote-tracking branch 'origin/2.5' into 2.6 2019-06-12 13:23:41 +02:00
Christian Kamm
98ba64e60c 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.

(cherry picked from commit 677e44dc53)

Cherry-picked to allow 2.5 users with new enough Qt to test the HTTP2
workaround.
2019-06-12 13:16:32 +02:00
Christian Kamm
42e4d1061f 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.
2019-06-12 13:09:50 +02:00
Christian Kamm
fd523c3b0f HTTP2: Enable if using Qt >=5.12.4 #7092
This Qt version fixes QTBUG-73947 and along with the resend workaround
for #7174 HTTP2 should work more reliably.
2019-06-07 19:26:44 +02:00
Christian Kamm
677e44dc53 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.
2019-06-07 19:26:19 +02:00
Christian Kamm
d7d55865fb 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.

(cherry picked from commit 2a900901d3)

Cherry picked as it seems likely to decrease the severety of #6877: if
the database isn't closed and reopened as frequently users are less
likely to run into crashes when the sqlite connection switches to wal
journaling mode.
2019-06-07 09:30:52 +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
Olivier Goffart
819175ad89 SyncEngine: Fix renaming a single file cause the "delete all file" popup
Possibly a regression, since the new discovery discovers rist the renamed
files as removed

Issue #7204
2019-06-04 15:56:35 +02:00
Christian Kamm
dbae6bf224 SocketAPI: Add "show versions" to shell context menu #7196
The new menu entry depends on the privateLinksDetailsParam
capability of the server.
2019-06-04 12:26:15 +02:00
Markus Goetz
dc2a37e813 OAuth2: Better error logging
This does not fix a bug, just was found while spotting a bug that was no bug.
For https://github.com/owncloud/enterprise/issues/2951
2019-05-15 09:58:59 +02:00
Christian Kamm
87cd1c38be Merge remote-tracking branch 'origin/2.5' into 2.6 2019-05-13 07:51:54 +02:00
Christian Kamm
87a6e039a7 Chunked upload: Fix percent encoding in If header #7176 2019-05-07 10:09:18 +02:00
Christian Kamm
f2f42d61d7 LogWindow: Option to disable automatic deletion #7154 2019-05-07 07:27:12 +02:00
Christian Kamm
03b65e210b 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.
2019-04-26 13:51:18 +02:00
Christian Kamm
7940f6c21d 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.
2019-04-26 13:50:36 +02:00
Christian Kamm
2a900901d3 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.
2019-04-16 13:41:24 +02:00
Christian Kamm
699582e533 Discovery: Improvements to doc comments 2019-04-12 13:56:29 +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
5cbf60c6f4 About: Add remark about vfs plugin that's in use #7137 2019-04-10 14:51:15 +02:00
Christian Kamm
10c60b6e7a Fix windows build 2019-04-10 08:18:49 +02:00
Christian Kamm
fcf2af3be6 LogWindow: Remove output, add "go to log folder" button #6475 2019-04-09 13:15:05 +02:00
Christian Kamm
2b0f32c645 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.
2019-04-09 12:52:30 +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
f7d4b29df9 PropagateDirectory: Set initial dir mtime to server mtime #7119
It's still not synced in any way later.
2019-04-09 10:10:41 +02:00
Christian Kamm
31c699be26 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.
2019-04-09 10:10:41 +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
4a2d74062a owncloudcmd: Use env vars for chunk sizes #7078
Moves a bunch of env var reading from Folder into SyncOptions.
2019-04-09 10:08:01 +02:00
Christian Kamm
9c34e07d10 Vfs suffix: Require suffix when creating placeholder files 2019-03-29 09:43:43 +01:00