QIcon icon;
if (item._status == SyncFileItem::NormalError
- || item._status == SyncFileItem::FatalError) {
+ || item._status == SyncFileItem::FatalError
+ || item._status == SyncFileItem::BlacklistedError) {
icon = Theme::instance()->syncStateIcon(SyncResult::Error);
} else if (Progress::isWarningKind(item._status)) {
icon = Theme::instance()->syncStateIcon(SyncResult::Problem);
// An ignoreDuration of 0 mean we're tracking the error, but not actively
// suppressing it.
if (item._hasBlacklistEntry && newEntry._ignoreDuration > 0) {
- item._status = SyncFileItem::FileIgnored;
- item._errorString.prepend(PropagateItemJob::tr("Continue blacklisting:") + " ");
+ item._status = SyncFileItem::BlacklistedError;
qCInfo(lcPropagator) << "blacklisting " << item._file
<< " for " << newEntry._ignoreDuration
case SyncFileItem::Conflict:
case SyncFileItem::FileIgnored:
case SyncFileItem::NoStatus:
+ case SyncFileItem::BlacklistedError:
// nothing
break;
}
{
return kind == SyncFileItem::SoftError || kind == SyncFileItem::NormalError
|| kind == SyncFileItem::FatalError || kind == SyncFileItem::FileIgnored
- || kind == SyncFileItem::Conflict || kind == SyncFileItem::Restoration;
+ || kind == SyncFileItem::Conflict || kind == SyncFileItem::Restoration
+ || kind == SyncFileItem::BlacklistedError;
}
bool Progress::isIgnoredKind(SyncFileItem::Status kind)
}
}
+ int waitSeconds = entry._lastTryTime + entry._ignoreDuration - now;
qCInfo(lcEngine) << "Item is on blacklist: " << entry._file
<< "retries:" << entry._retryCount
- << "for another" << (entry._lastTryTime + entry._ignoreDuration - now) << "s";
- item._instruction = CSYNC_INSTRUCTION_ERROR;
- item._status = SyncFileItem::FileIgnored;
- item._errorString = tr("The item is not synced because of previous errors: %1").arg(entry._errorString);
+ << "for another" << waitSeconds << "s";
+
+ // We need to indicate that we skip this file due to blacklisting
+ // for reporting and for making sure we don't update the blacklist
+ // entry yet.
+ // Classification is this _instruction and _status
+ item._instruction = CSYNC_INSTRUCTION_IGNORE;
+ item._status = SyncFileItem::BlacklistedError;
+
+ auto waitSecondsStr = Utility::durationToDescriptiveString1(1000 * waitSeconds);
+ item._errorString = tr("%1 (skipped due to earlier error, trying again in %2)").arg(entry._errorString, waitSecondsStr);
return true;
}
SoftLink = CSYNC_FTW_TYPE_SLINK
};
- enum Status {
+ enum Status { // stored in 4 bits
NoStatus,
FatalError, ///< Error that causes the sync to stop
Success, ///< The file was properly synced
Conflict, ///< The file was properly synced, but a conflict was created
FileIgnored, ///< The file is in the ignored list (or blacklisted with no retries left)
- Restoration ///< The file was restored because what should have been done was not allowed
+ Restoration, ///< The file was restored because what should have been done was not allowed
+
+ /** For files whose errors were blacklisted.
+ *
+ * If _instruction == IGNORE, the file wasn't even reattempted.
+ *
+ * These errors should usually be shown as NormalErrors, but not be as loud
+ * as them.
+ */
+ BlacklistedError
};
SyncFileItem()
return item._instruction == CSYNC_INSTRUCTION_ERROR
|| status == SyncFileItem::NormalError
|| status == SyncFileItem::FatalError
+ || status == SyncFileItem::BlacklistedError
|| item._hasBlacklistEntry;
}