emit serverVersionChanged(this, oldServerVersion, version);
}
-bool Account::rootEtagChangesNotOnlySubFolderEtags()
-{
- return (serverVersionInt() >= makeServerVersion(8, 1, 0));
-}
-
void Account::setNonShib(bool nonShib)
{
if (nonShib) {
*/
bool serverVersionUnsupported() const;
- // Fixed from 8.1 https://github.com/owncloud/client/issues/3730
- /** Detects a specific bug in older server versions */
- bool rootEtagChangesNotOnlySubFolderEtags();
-
/** True when the server connection is using HTTP2 */
bool isHttp2Supported() { return _http2Supported; }
void setHttp2Supported(bool value) { _http2Supported = value; }
if (_queryServer == NormalQuery) {
serverJob = new DiscoverySingleDirectoryJob(_discoveryData->_account,
_discoveryData->_remoteFolder + _currentFolder._server, this);
+ connect(serverJob, &DiscoverySingleDirectoryJob::etag, this, &ProcessDirectoryJob::etag);
connect(serverJob, &DiscoverySingleDirectoryJob::finished, this, [this, serverJob](const auto &results) {
if (results) {
_serverEntries = *results;
signals:
void finished();
+ // The root etag of this directory was fetched
+ void etag(const QString &);
};
}
//This works in concerto with the RequestEtagJob and the Folder object to check if the remote folder changed.
if (map.contains("getetag")) {
- _etagConcatenation += map.value("getetag");
-
if (_firstEtag.isEmpty()) {
_firstEtag = map.value("getetag"); // for directory itself
}
return;
}
emit etag(_firstEtag);
- emit etagConcatenation(_etagConcatenation);
emit finished(_results);
deleteLater();
}
// This is not actually a network job, it is just a job
signals:
void firstDirectoryPermissions(RemotePermissions);
- void etagConcatenation(const QString &);
void etag(const QString &);
void finished(const Result<QVector<RemoteInfo>> &result);
private slots:
private:
QVector<RemoteInfo> _results;
QString _subPath;
- QString _etagConcatenation;
QString _firstEtag;
AccountPtr _account;
// The first result is for the directory itself and need to be ignored.
void RequestEtagJob::start()
{
QNetworkRequest req;
- if (_account && _account->rootEtagChangesNotOnlySubFolderEtags()) {
- // Fixed from 8.1 https://github.com/owncloud/client/issues/3730
- req.setRawHeader("Depth", "0");
- } else {
- // Let's always request all entries inside a directory. There are/were bugs in the server
- // where a root or root-folder ETag is not updated when its contents change. We work around
- // this by concatenating the ETags of the root and its contents.
- req.setRawHeader("Depth", "1");
- // See https://github.com/owncloud/core/issues/5255 and others
- }
+ req.setRawHeader("Depth", "0");
QByteArray xml("<?xml version=\"1.0\" ?>\n"
"<d:propfind xmlns:d=\"DAV:\">\n"
auto discoveryJob = new ProcessDirectoryJob(SyncFileItemPtr(), ProcessDirectoryJob::NormalQuery, ProcessDirectoryJob::NormalQuery,
_discoveryPhase.data(), _discoveryPhase.data());
_discoveryPhase->startJob(discoveryJob);
-
- /*
- * FIXME
- if (account()->rootEtagChangesNotOnlySubFolderEtags()) {
- connect(_discoveryMainThread.data(), &DiscoveryMainThread::etag, this, &SyncEngine::slotRootEtagReceived);
- } else {
- connect(_discoveryMainThread.data(), &DiscoveryMainThread::etagConcatenation, this, &SyncEngine::slotRootEtagReceived);
- }
-
- */
+ connect(discoveryJob, &ProcessDirectoryJob::etag, this, &SyncEngine::slotRootEtagReceived);
}
void SyncEngine::slotFolderDiscovered(bool local, const QString &folder)