Skip to content

Commit

Permalink
when sync is completed and data fingerprint changed, update it
Browse files Browse the repository at this point in the history
in case sync would complete after a data fingerprint change, we should
tolerate some errors

a file being blacklisted for whatever reason should not block the
propagation of data fingerprint

Signed-off-by: Matthieu Gallien <[email protected]>
  • Loading branch information
mgallien authored and backportbot-nextcloud[bot] committed Oct 17, 2023
1 parent bd2613c commit 37fbd94
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/libsync/owncloudpropagator.h
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,9 @@ private slots:
/** Emit the finished signal and make sure it is only emitted once */
void emitFinished(OCC::SyncFileItem::Status status)
{
if (!_finishedEmited)
emit finished(status == SyncFileItem::Success);
if (!_finishedEmited) {
emit finished(status);
}
_abortRequested = false;
_finishedEmited = true;
}
Expand All @@ -645,7 +646,7 @@ private slots:
void newItem(const OCC::SyncFileItemPtr &);
void itemCompleted(const SyncFileItemPtr &item, OCC::ErrorCategory category);
void progress(const OCC::SyncFileItem &, qint64 bytes);
void finished(bool success);
void finished(OCC::SyncFileItem::Status status);

/** Emitted when propagation has problems with a locked file. */
void seenLockedFile(const QString &fileName);
Expand Down
6 changes: 3 additions & 3 deletions src/libsync/syncengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -947,13 +947,13 @@ void SyncEngine::slotItemCompleted(const SyncFileItemPtr &item, const ErrorCateg
emit itemCompleted(item, category);
}

void SyncEngine::slotPropagationFinished(bool success)
void SyncEngine::slotPropagationFinished(OCC::SyncFileItem::Status status)
{
if (_propagator->_anotherSyncNeeded && _anotherSyncNeeded == NoFollowUpSync) {
_anotherSyncNeeded = ImmediateFollowUp;
}

if (success && _discoveryPhase) {
if ((status == SyncFileItem::Success || status == SyncFileItem::BlacklistedError) && _discoveryPhase) {
_journal->setDataFingerprint(_discoveryPhase->_dataFingerprint);
}

Expand All @@ -970,7 +970,7 @@ void SyncEngine::slotPropagationFinished(bool success)
_progressInfo->_status = ProgressInfo::Done;
emit transmissionProgress(*_progressInfo);

finalize(success);
finalize(status == SyncFileItem::Success);
}

void SyncEngine::finalize(bool success)
Expand Down
2 changes: 1 addition & 1 deletion src/libsync/syncengine.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ private slots:

void slotItemCompleted(const OCC::SyncFileItemPtr &item, const OCC::ErrorCategory category);
void slotDiscoveryFinished();
void slotPropagationFinished(bool success);
void slotPropagationFinished(SyncFileItem::Status status);
void slotProgress(const OCC::SyncFileItem &item, qint64 current);
void slotCleanPollsJobAborted(const QString &error, const OCC::ErrorCategory category);

Expand Down

0 comments on commit 37fbd94

Please sign in to comment.