1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2024-09-29 09:42:45 +02:00
Commit Graph

16179 Commits

Author SHA1 Message Date
Christian Kamm
f6ca649308
Do not require server replies to contain an mtime
The check was added for #6317 in commit
13eb64584f.

We did see missing mtimes in replies in tests with live servers though.
Possibly those were old incomplete responses cached in the stat cache?
2020-12-15 10:58:02 +01:00
Olivier Goffart
9401273daf
New discovery algorithm: Call FolderDiscovered 2020-12-15 10:58:02 +01:00
Olivier Goffart
a36ed56f01
New Discovery algorithm: Refactor a bit the way the signal are emited 2020-12-15 10:58:02 +01:00
Olivier Goffart
8f3ce6e520
Fix TestDownload: _ignore_hidden_files was not properly initialized 2020-12-15 10:58:02 +01:00
Olivier Goffart
b6487181c6
New Discovery Phase: fix a few FIXME
Some FIXME were already fixed.
2020-12-15 10:58:02 +01:00
Olivier Goffart
9863500ec1
New discovery algorithm: handle symlinks 2020-12-15 10:58:01 +01:00
Olivier Goffart
a9ec521bf1
New discovery algo: Handle Database error 2020-12-15 10:58:01 +01:00
Olivier Goffart
d6fc3b6e0a
Skip failing test
These tests are failling because now we consider that any files that ends
with .owncloud is a virtual file, regardless what the DB say.
2020-12-15 10:58:01 +01:00
Olivier Goffart
1bcbcd407c
New discovery phase: read the direct download URL and Cookie 2020-12-15 10:58:01 +01:00
Olivier Goffart
ca32eb1cf7
More cleanup of csync remains 2020-12-15 10:58:01 +01:00
Olivier Goffart
ac24cdbde6
New Discovery Algo: Permsission check 2020-12-15 10:58:01 +01:00
Olivier Goffart
0a6d2d0f46
Remove csync_update and csync_reconcile
I guess some other csync utilities can also be remove dnow but
that will be for later
2020-12-15 10:58:00 +01:00
Olivier Goffart
5994c65ecb
Remove the check_csync_update test
since csync_update is going away
2020-12-15 10:58:00 +01:00
Olivier Goffart
57068b0fd9
New Discovery Algorithm: handle server errors 2020-12-15 10:58:00 +01:00
Olivier Goffart
4031fb6d5b
Backport 64014dd374 2020-12-15 10:58:00 +01:00
Olivier Goffart
6794306dde
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
2020-12-15 10:58:00 +01:00
Olivier Goffart
75a1f2d089
Convert p7.pl to a C++ test
This is just a translation of test/scripts/txpl/t7.pl to C++ using the test
framework.
2020-12-15 10:58:00 +01:00
Olivier Goffart
f4a5167812
New Discovery Algo: Support the DatabaseAndFilesystem mode for local discovery 2020-12-15 10:57:59 +01:00
Olivier Goffart
370923791d
New Disco algortihm: Fix TestChunkingNG::connectionDroppedBeforeEtagRecieved
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:57:59 +01:00
Olivier Goffart
710934bdbd
New disco algo: Fix TestSyncFileStatusTracker 2020-12-15 10:57:59 +01:00
Olivier Goffart
f926248937
New discovery algorithm: More work on virtual files 2020-12-15 10:57:59 +01:00
Olivier Goffart
35e40b58ca
New Disco algorithm: Type change (file to dir) 2020-12-15 10:57:59 +01:00
Olivier Goffart
1e8c37d3d6
New discovery algorithm: Virtual files
The commented tests lines were implementation details
2020-12-15 10:57:59 +01:00
Olivier Goffart
22d989e272
New discovery algorithm: Fix directory deletion
TestAllFilesDeleted passes
2020-12-15 10:57:59 +01:00
Olivier Goffart
d54e00488a
New Discovery algorithm
Some error handling. In particular for the case where there is a conflict
between files and directories.

SyncEngineTest and SyncMoveTest passes
2020-12-15 10:57:58 +01:00
Olivier Goffart
a384a2d1cb
New Discovery algorithm: Handle of move within a moved directory 2020-12-15 10:57:58 +01:00
Olivier Goffart
bdd1e72dda
New discovery algoritmh: more on Renames 2020-12-15 10:57:58 +01:00
Olivier Goffart
f43d07dc05
New Discovery algorithm: Check that the original file is still on the server while renaming 2020-12-15 10:57:58 +01:00
Olivier Goffart
7e36cc3fcb
New disco algorithm: Fix some moving
Fix TestSyncMove::testSelectiveSyncMovedFolder
2020-12-15 10:57:58 +01:00
Olivier Goffart
5a57a36729
New discovery algorithm: Local rename 2020-12-15 10:57:58 +01:00
Olivier Goffart
f9a9be59e6
New discovery algo: Remote move
TestSyncMove::testRemoteChangeInMovedFolder
2020-12-15 10:57:57 +01:00
Olivier Goffart
92ddc60900
Handle Encoding Problems
TestSyncEngine now passes
2020-12-15 10:57:57 +01:00
Olivier Goffart
501da58b10
Ignore Hidden Files 2020-12-15 10:57:57 +01:00
Olivier Goffart
8bf69cf0cd
Port the invalid napme regexp
TestSyncEngine::testInvalidFilenameRegex
2020-12-15 10:57:57 +01:00
Olivier Goffart
9efd21d70b
More progress
TestSyncEngine::testFakeConflict / TestSyncEngine::testSyncFileItemProperties
2020-12-15 10:57:57 +01:00
Olivier Goffart
e934f6b27b
New discovery algo
Make TestSyncEngine::testSelectiveSyncBug pass
2020-12-15 10:57:57 +01:00
Olivier Goffart
4066c1a004
New discovery: TestSyncEngine::testEmlLocalChecksum 2020-12-15 10:57:57 +01:00
Olivier Goffart
9bf417d930
New discovery algorithm
Some progress:
TestSyncEngine::testDirUpload
2020-12-15 10:57:56 +01:00
Olivier Goffart
ec681ab2a5
New discovery algorithm: Initial work.
SyncEngineTest testFileDownload is passing
2020-12-15 10:57:56 +01:00
Kevin Ottens
ba0d465e47
Revert "Merge pull request #1454 from nextcloud/syncjournal-del-prio"
This reverts commit d9fd9cfef2, reversing
changes made to 2dcf594fc6.
2020-12-15 10:57:56 +01:00
Dominik Schmidt
07f331717f
Rename ocsync library to ${APPLICATION_EXECUTABLE}_csync 2020-12-15 10:57:56 +01:00
Dominik Schmidt
aad928a6be
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.
2020-12-15 10:57:56 +01:00
Olivier Goffart
919debccfc
nautilus shell integration: Fix when there are several branded client installed
It appears that several extension can be loaded at the same time, but their
classname for the extension need to be different, otherwise only the last
loaded one would be active.

Issue #6524
2020-12-15 10:57:55 +01:00
Olivier Goffart
0155a4fa73
Wizard + OAuth: Make opening a new browser after clicking back works again
Issue #6574

When there is an error in the advanced page, OwncloudAdvancedSetupPage::updateStatus
(and others) call completeChanged(), which is connected to
QWizardPrivate::_q_updateButtonStates which will re-enable the back button from the
last page.

When the user click "back" and re-open the browser, the account's credentials
already have a oauth token set. So the call to the API to get a new token fails
because we use the previous token instead of using the client's secret_id.
Fix this with the HttpCredentials::DontAddCredentialsAttribute.

Now, this is still not working because the session cookies are confusing the
server.  So we'll clear the cookies when re-opening the browser
2020-12-15 10:57:55 +01:00
Olivier Goffart
d8e761ab61
FindSql3.cmake: Add the input variable in the search path
Issue #6278
2020-12-15 10:57:55 +01:00
Olivier Goffart
0d21936e95
FolderStatusModel: Fix crash when there is an error while expanding folders
In FolderStatusModel::slotLscolFinishedWithError, the call to parentInfo->resetSubs
deleted the 'job' and the reply 'r' which we accessed later to get the error code.

Fix this problem twice by
 1) Get the error code before caling resetSubs
 2) in FolderStatusModel::SubFolderInfo::resetSubs, call deleteLater instead of delete

Regression introduced in commit d69936e0

Issue #6562
2020-12-15 10:57:55 +01:00
Olivier Goffart
cf3846c565
csync: refactor csync_s::error_string to avoid valgrind error
The problem here is that we were sometimes allocating the error_string with
qstrdup, which need to be released with delete[] and not free().

Simplify the code by using QString instead.

```
==7230== Mismatched free() / delete / delete []
==7230==    at 0x4C2E10B: free (vg_replace_malloc.c:530)
==7230==    by 0x57C2321: csync_s::reinitialize() (csync.cpp:247)
==7230==    by 0x548130F: OCC::SyncEngine::finalize(bool) (syncengine.cpp:1212)
==7230==    by 0x5481223: OCC::SyncEngine::handleSyncError(csync_s*, char const*) (syncengine.cpp:746)
==7230==    by 0x5483E78: OCC::SyncEngine::slotDiscoveryJobFinished(int) (syncengine.cpp:965)
==7230==    by 0x5495E34: QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<int>, void, void (OCC::SyncEngine::*)(int)>::call(void (OCC::SyncEngine::*)(int), OCC::SyncEngine*, void**) (qobjectdefs_impl.h:134)
==7230==    by 0x5495D92: void QtPrivate::FunctionPointer<void (OCC::SyncEngine::*)(int)>::call<QtPrivate::List<int>, void>(void (OCC::SyncEngine::*)(int), OCC::SyncEngine*, void**) (qobjectdefs_impl.h:167)
==7230==    by 0x5495CB5: QtPrivate::QSlotObject<void (OCC::SyncEngine::*)(int), QtPrivate::List<int>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (qobjectdefs_impl.h:396)
==7230==    by 0xA9BF2E1: QObject::event(QEvent*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==    by 0x64BE983: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.11.0)
==7230==    by 0x64C625A: QApplication::notify(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.11.0)
==7230==    by 0xA994BC8: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==  Address 0x225b2640 is 0 bytes inside a block of size 50 alloc'd
==7230==    at 0x4C2DC6F: operator new[](unsigned long) (vg_replace_malloc.c:423)
==7230==    by 0xA7E8FC8: qstrdup(char const*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==    by 0x53F5750: OCC::DiscoveryJob::remote_vio_opendir_hook(char const*, void*) (discoveryphase.cpp:666)
==7230==    by 0x57E1278: csync_vio_opendir(csync_s*, char const*) (csync_vio.cpp:39)
==7230==    by 0x57D718F: csync_ftw(csync_s*, char const*, int (*)(csync_s*, std::unique_ptr<csync_file_stat_s, std::default_delete<csync_file_stat_s> >), unsigned int) (csync_update.cpp:674)
==7230==    by 0x57C1B05: csync_update(csync_s*) (csync.cpp:109)
==7230==    by 0x53F5BCC: OCC::DiscoveryJob::start() (discoveryphase.cpp:718)
==7230==    by 0x54B8F74: OCC::DiscoveryJob::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_discoveryphase.cpp:494)
==7230==    by 0xA9BF2E1: QObject::event(QEvent*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==    by 0x64BE983: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.11.0)
==7230==    by 0x64C625A: QApplication::notify(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.11.0)
==7230==    by 0xA994BC8: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/libQt5Core.so.5.11.0)
==7230==
```
2020-12-15 10:57:55 +01:00
Olivier Goffart
857afd32df
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.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:57:55 +01:00
Olivier Goffart
5bd902de9c
.desktop file: the MimeType entry must ends with a semi colon
Also remove some comments
2020-12-15 10:57:55 +01:00
Olivier Goffart
4ee244190b
Virtual Files: Allow to download a folder recursively from the socket API
Issue: #6466
2020-12-15 10:57:54 +01:00