1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2024-11-25 19:42:45 +01:00
Commit Graph

412 Commits

Author SHA1 Message Date
Christian Kamm
777e6ff5e0 PropagateUpload: Avoid crash due to cascading aborts
https://sentry.io/owncloud/desktop-win-and-mac/issues/698694072/activity/
2018-10-09 13:25:54 +02:00
Olivier Goffart
8a08a51540 Fix leaks in tests
As discovered by AddressSanitizer
2018-10-05 19:03:08 +02:00
Christian Kamm
5e442f588e Virtual files: Renames propagate #6718 2018-09-26 16:39:41 +02:00
Olivier Goffart
0abf2c603e Fix tx.pl
The conflict filename changed
2018-09-06 10:57:12 +02:00
Christian Kamm
9b7da91f6d Private links: improve legacy fileid derivation #6745 2018-08-31 18:10:01 +02:00
Christian Kamm
b4f63ca219 Conflicts: Rename BasePath to InitialBasePath #6709 2018-08-22 09:03:54 +02:00
Olivier Goffart
64c1f7752b Fix test link with older Qt 2018-08-21 10:45:27 +02:00
Olivier Goffart
c85cd8e225 Conflict handling: add the OC-ConflictBasePath header
Issue #6702
2018-08-19 21:22:08 +02:00
Olivier Goffart
d1e15b7802 Virtual Files: Set the mtime of the virtual file to that of the server
Note: When the server mtime is modified, the mtime of the file is not updated

Issue #6727
2018-08-19 21:11:59 +02:00
Christian Kamm
0b9049e6ff Virtual files: Renaming to virtual doesn't delete data #6718
Unfortunately to do this, the local update phase must write to the
database, creating a new side-effect and order dependency (local update
must run before remote update).
2018-08-17 14:27:09 +02:00
Olivier Goffart
4a3fce531c SyncEngine: Fix renames making hierarchy inversion
Issue #6694
2018-08-16 10:38:18 +02:00
Christian Kamm
c8ecbc30ed RemotePermissions: Fix empty vs null
Fixes two bugs that appeared since the introduction of the struct:
- when reading permissions from the journal, null ("") was read as
  empty-not-null
- when reading permissinos from the server, empty ("") was read as null

Addresses #4608
2018-08-16 09:08:17 +02:00
Olivier Goffart
58f46010b5 SyncEngine: Fix the "direction" of the "all file delted" message when the server is reset
Using the direction of the "first" item is not enough as it might be a directory
which is a UPDATE_META_DATA,  or there can have been a few changes locally as well.

As reported on https://github.com/owncloud/client/issues/6317#issuecomment-412163113
2018-08-15 09:34:19 +02:00
Olivier Goffart
58d6632eaf Data-Fingerprint: Fix backup detection when fingerprint is empty
Add a test to test the data fingerprint feature make me realize it was broken.
The code was relying in the distinction between empty and null QByteArray,
but this was a bad idea as this difference is lost when going through QString.
2018-08-14 10:57:20 +02:00
Olivier Goffart
56166deb76 Added test that checks what happens when there is an error in the remote discovery
(Many of the expected error string are left empty because the current
error message is not insterresting
2018-07-25 13:48:58 +02:00
Olivier Goffart
a0675bd0ab Convert p7.pl to a C++ test
This is just a translation of test/scripts/txpl/t7.pl to C++ using the test
framework.
2018-07-25 13:48:58 +02:00
Olivier Goffart
d6b7bde3ca TestChunkingNG: Make it faster
Use smaller files so the test run faster.
Particulary usefull for TestChunkingNG::connectionDroppedBeforeEtagRecieved
Which had become so much slower after 2638332dc6
increased the timeout for bigger files
2018-07-18 15:48:43 +02:00
Olivier Goffart
d7e77b7473 FolderMan::checkPathValidityForNewFolder: make sure to work when folder points to deleted folders
Note that we also needed to adjust the server url to contains the user name
in the folder wizard. (As checkPathValidityForNewFolder expect the user name)

Issue #6654
2018-07-17 09:02:37 +02:00
Olivier Goffart
90ec9a9735 Reconcile: When detecting a local move, keep the local mtime
https://github.com/owncloud/client/issues/6629#issuecomment-402450691
2018-07-05 16:31:16 +02:00
Olivier Goffart
64014dd374 Upload: Store the size in the UploadInfo, and compare it when resolving potential conflict
This is about the conflicts that happens when the file has been uploaded
correctly to the server, but the etag was not recieved because the connection
was closed before we got the reply.

We used to compare only the mtime when comparing the uploaded file and the
existing file.  However, to be perfectly correct, we also should check the
size.

This was found because TestChunkingNG::connectionDroppedBeforeEtagRecieved is
flaky. Example of faillure found in https://drone.owncloud.com/owncloud/client/481/5
while testing PR #6626

(very trimmed log:)

06-29 07:58:02:015 [ info sync.csync.csync ]:	## Starting local discovery ##
06-29 07:58:02:016 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag:  <-> 1644a8c8750, inode: 1935629 <-> 1935629, size: 301 <-> 300, perms: 0 <-> ff, type: 0 <-> 0, checksum:  <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:016 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:972 [ warning sync.networkjob ]:	QNetworkReply::NetworkError(OperationCanceledError) "Connection timed out" QVariant(Invalid)
.. next sync...
06-29 07:58:02:980 [ info sync.engine ]:	#### Discovery start ####################################################
06-29 07:58:02:981 [ info sync.csync.csync ]:	## Starting local discovery ##
06-29 07:58:02:983 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag:  <-> 1644a8c8750, inode: 1935629 <-> 1935629, size: 302 <-> 300, perms: 0 <-> ff, type: 0 <-> 0, checksum:  <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:983 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:985 [ info sync.csync.csync ]:	## Starting remote discovery ##
06-29 07:58:02:985 [ info sync.networkjob ]:	OCC::LsColJob created for "http://localhost/owncloud" + "" "OCC::DiscoverySingleDirectoryJob"
06-29 07:58:02:987 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag: 1644a8c8b26 <-> 1644a8c8750, inode: 0 <-> 1935629, size: 301 <-> 300, perms: ff <-> ff, type: 0 <-> 0, checksum: SHA1:5adcdac9608ae0811247f07f4cf1ab0a2ef99154 <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:987 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:989 [ info sync.csync.csync ]:	Update detection for remote replica took 0.004 seconds walking 13 files
06-29 07:58:02:990 [ info sync.engine ]:	#### Discovery end ####################################################  9 ms
06-29 07:58:02:990 [ info sync.database ]:	Updating file record for path: "A/a0" inode: 1935629 modtime: 1530259082 type: 0 etag: "1644a8c8b26" fileId: "16383ea4" remotePerm: "WDNVCKR" fileSize: 301 checksum: "SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1"
06-29 07:58:02:990 [ info sync.csync.reconciler ]:	INSTRUCTION_UPDATE_METADATA    client file: A/a0
06-29 07:58:02:990 [ info sync.csync.csync ]:	Reconciliation for local replica took  0 seconds visiting  13  files.
06-29 07:58:02:990 [ info sync.csync.reconciler ]:	INSTRUCTION_UPDATE_METADATA    server dir:  A
06-29 07:58:02:990 [ info sync.csync.csync ]:	Reconciliation for remote replica took  0 seconds visiting  13  files.
06-29 07:58:02:990 [ info sync.engine ]:	#### Reconcile end ####################################################  9 ms
06-29 07:58:02:990 [ info sync.database ]:	Updating local metadata for: "A/a0" 1530259082 302 1935629
FAIL!  : TestChunkingNG::connectionDroppedBeforeEtagRecieved(small file) '!fakeFolder.syncOnce()' returned FALSE. ()
2018-07-04 17:26:56 +02:00
Olivier Goffart
7029ad1a29 TestOAuth: Don't have global static QObject
Fix a strange warning seen on the log from the CI on Windows in
https://github.com/owncloud/client/pull/6621

The test shows, at the beginning
QObject::connect: No such signal DesktopServiceHook::destroyed(QObject*)
And crashes at the and.

My guess is that when QDesktopServices::setUrlHandler is called, the
QMetaObject is not yet initialized

But this is probably not the reason of the crash
2018-06-29 10:57:24 +02:00
Dominik Schmidt
4f96647bae Rename ocsync library to ${APPLICATION_EXECUTABLE}_csync 2018-06-20 11:23:16 +02:00
Dominik Schmidt
79ef892e71 Install libocsync to lib/ without subfolder.
Installing to lib/${APPLICATION_EXECUTABLE} has caused a bunch of
irritations in the past and subtle annoying to fix bugs. To avoid name
clashes with branded clients ${APPLICATION_EXECUTABLE} becomes now
part of the filename instead of the subfolder.

The concrete motivation to change this now is that on Windows there
is no RPATH and it's not possible to run owncloud directly from the
Craft Root folder, which is nice when you're developing on Windows.

It would have been possible to change this just for Windows but as
written earlier this has caused lots of issues and thus I think it's
a good idea to just stay consistent accross platforms when touching it.
2018-06-20 11:23:16 +02:00
Christian Kamm
ad2446b036 Ensure GETFileJob notices finishing #6581
It could happen that readyRead was emitted for incoming data while the
download was not yet finished. Then the network job could finish with
no more data arriving - so readyRead wasn't emitted again.

To fix this, the finished signal also gets connected to the readyRead
slot.
2018-06-13 16:44:24 +02:00
Olivier Goffart
13cb9ab1c5 PropagateDownload: Don't discard the body of error message
We want to keep the body so we can get the message from it
(Issue #6459)

TestDownload::testErrorMessage did not fail because the FakeErrorReply
did not emit readyRead and did not implement bytesAvailable.
2018-06-01 13:21:22 +02:00
Olivier Goffart
1753ce651b Virtual Files: Allow to download a folder recursively from the socket API
Issue: #6466
2018-05-30 11:57:57 +02:00
Christian Kamm
3a7a6b0b9e Virtual files: Wipe virtual after download completes, not before
Otherwise a interrupted or unsuccessful download would mean that the
download-intend was forgotten. The next sync would reestablish the
virtual file instead.
2018-05-30 11:50:14 +02:00
Christian Kamm
252484e875 Virtual files: Only remove virtual file once on download
With thanks to @ogoffart for spotting the problem.
2018-05-30 10:39:49 +02:00
Christian Kamm
8f9f2b5462 Rename Placeholders to Virtual Files in code #6531 2018-05-23 09:57:00 +02:00
Christian Kamm
394ef439e0 Merge branch 'master' into 2.5 2018-05-17 13:23:20 +02:00
Olivier Goffart
e7e8a62bb7 Blacklist: remember the X-Request-ID
Issue #6420
Store the X-Request-ID in the SyncFileItem and also in the blacklist.
Note that for consistency reason, the X-Request-ID is also in the
SyncFileItem if the request succeeds.

Currently there is no UI to access it, but it can be queried with sql
commands
2018-05-15 18:11:01 +02:00
Christian Kamm
8d14f4357a Placeholder: Stop adding ignore pattern
Because we can't make older clients preserve the version directive that
was attached to it.

See #6504 and #6498
2018-05-15 14:26:35 +02:00
Christian Kamm
34d40e6c67 Placeholder: Don't contain "stub" 2018-05-15 14:26:35 +02:00
Christian Kamm
8b952d3741 TestChunkingNG: Remove unneeded test code 2018-05-15 09:42:54 +02:00
Christian Kamm
9555f8d75c Show a tray message when a folder watcher becomes unreliable #6119 2018-04-24 13:06:50 +02:00
Olivier Goffart
c5701f635a Fix test: QTemporaryDir::filePath was added in Qt 5.9 2018-04-19 17:01:31 +02:00
Christian Kamm
a5271b529b LocalDiscoveryTracker: Add unit test #6120 2018-04-19 10:58:46 +02:00
Christian Kamm
7c558394c1 LocalDiscoveryTracker: Separate from Folder and move to libsync
To allow relevant code to be closer together and for testing in
unittests without having to get a gui Folder.

See #6120
2018-04-19 10:58:46 +02:00
Christian Kamm
985a657f48 Merge remote-tracking branch 'origin/master' 2018-04-18 11:14:08 +02:00
Christian Kamm
9e8464e114 Merge branch 'placeholder-prototype' 2018-04-18 11:02:53 +02:00
Olivier Goffart
02b818af04 Download: Use the <s:message> from the reply in the error message if any
Issue: #6459
2018-04-18 10:57:16 +02:00
Olivier Goffart
0fdfb2cba3 Add a test for resuming downloads 2018-04-18 10:57:16 +02:00
Christian Kamm
65a2b1aa8a Placeholders: Fix migration issues
Some edgecases weren't covered and didn't have tests yet.
2018-04-18 10:27:51 +02:00
Christian Kamm
c2f84d7c3e Placeholders: Ignore placeholder files in older clients
To do this, we add the placeholder extension to the user exclude file
automatically. However, newer clients shouldn't use that exclude
pattern: so we also add version directives that allow making exclude
patterns dependent on the client version.
2018-04-18 10:27:51 +02:00
Christian Kamm
01bb241e48 Placeholders: Safe migration to older client versions
Now the db entries for placeholders will have the full placeholder
paths. That way older clients will, on remote discovery, delete the
placeholders and download the real files.
2018-04-18 10:27:51 +02:00
Christian Kamm
e2f2c9a153 Placeholders: Deal with conflicts when a placeholder exists
So "foo.owncloud" exists but the user adds a new "foo".
2018-04-18 10:27:51 +02:00
Olivier Goffart
a2191474eb Placeholders: Move the placeholder option from the account to the folder 2018-04-18 10:27:51 +02:00
Christian Kamm
798e60c9f6 On-demand downloading: Placeholder-file based prototype
- Controled by an option.
- New remote files start out as ItemTypePlaceholder, are created with a
  .owncloud extension.
- When their db entry is set to ItemTypePlaceholderDownload the next
  sync run will download them.
- Files that aren't in the placeholder state sync as usual.
- See test cases in testsyncplaceholders.

Missing:
- User ui for triggering placeholder file download
- Maybe: Going back from file to placeholder?
2018-04-18 10:27:51 +02:00
Christian Kamm
fa6ac9da23 Upload: Add more chunk resuming unit tests #6405 2018-04-17 13:48:13 +02:00
Olivier Goffart
2c18ea0a89 Uploads: Don't delete unexisting chunks
Since commit 4dc49ff3, we store an entry in the upload info table even
for non chunked uploads. However, if this fails we don't want to remove
non-existant stale chunks if the upload fails.

Without this commit, we would send a DELETE command to clean non-existant
chunks in the dav/uploads/ namespace.
2018-04-16 12:00:12 +02:00