// It might be an E2EE mangled path, so let's try to demangle it
const auto journal = folder->journalDb();
SyncJournalFileRecord rec;
- journal->getFileRecordByE2eMangledName(remotePath, &rec);
+ if (!journal->getFileRecordByE2eMangledName(remotePath, &rec)) {
+ qCWarning(lcFolderStatus) << "Could not get file record by E2E Mangled Name from local DB" << remotePath;
+ }
const auto path = rec.isValid() ? rec._path : remotePath;
newInfo._path = relativePath;
SyncJournalFileRecord rec;
- parentInfo->_folder->journalDb()->getFileRecordByE2eMangledName(removeTrailingSlash(relativePath), &rec);
+ if (!parentInfo->_folder->journalDb()->getFileRecordByE2eMangledName(removeTrailingSlash(relativePath), &rec)) {
+ qCWarning(lcFolderStatus) << "Could not get file record by E2E Mangled Name from local DB" << removeTrailingSlash(relativePath);
+ }
if (rec.isValid()) {
newInfo._name = removeTrailingSlash(rec._path).split('/').last();
if (rec._isE2eEncrypted && !rec._e2eMangledName.isEmpty()) {
// If this is an E2EE file or folder, pretend we got no path, hiding the share button which is what we want
if (folder) {
SyncJournalFileRecord rec;
- folder->journalDb()->getFileRecord(fileName.mid(1), &rec);
+ if (!folder->journalDb()->getFileRecord(fileName.mid(1), &rec)) {
+ qCWarning(lcActivity) << "could not get file from local DB" << fileName.mid(1);
+ }
if (rec.isValid() && (rec._isE2eEncrypted || !rec._e2eMangledName.isEmpty())) {
return QString();
}
return;
}
- _propagator->_journal->deleteFileRecord(_item->_originalFile, _item->isDirectory());
+ if (!_propagator->_journal->deleteFileRecord(_item->_originalFile, _item->isDirectory())) {
+ qCWarning(ABSTRACT_PROPAGATE_REMOVE_ENCRYPTED) << "Failed to delete file record from local DB" << _item->_originalFile;
+ }
_propagator->_journal->commit("Remote Remove");
unlockFolder();
_userId != account()->davUser()) {
FileSystem::setFileReadOnly(relativePath, true);
}
- _journal->setFileRecord(record);
+ const auto result = _journal->setFileRecord(record);
+ if (!result) {
+ qCWarning(lcLockFileJob) << "Error when setting the file record to the database" << record._path << result.error();
+ }
_journal->commit("lock file job");
}
if (!propagator()->_journal->deleteFileRecord(_item->_originalFile)) {
qCWarning(lcPropagateDownload) << "could not delete file from local DB" << _item->_originalFile;
- done(SyncFileItem::NormalError, tr("could not delete file %1 from local DB").arg(_item->_originalFile));
+ done(SyncFileItem::NormalError, tr("Could not delete file record %1 from local DB").arg(_item->_originalFile));
return;
}
if (!propagator()->_journal->deleteFileRecord(virtualFile)) {
qCWarning(lcPropagateDownload) << "could not delete file from local DB" << virtualFile;
- done(SyncFileItem::NormalError, tr("could not delete file %1 from local DB").arg(virtualFile));
+ done(SyncFileItem::NormalError, tr("Could not delete file record %1 from local DB").arg(virtualFile));
return;
}
return;
}
- propagator()->_journal->deleteFileRecord(_item->_originalFile, _item->isDirectory());
+ if (!propagator()->_journal->deleteFileRecord(_item->_originalFile, _item->isDirectory())) {
+ qCWarning(lcPropagateRemoteDelete) << "could not delete file from local DB" << _item->_originalFile;
+ done(SyncFileItem::NormalError, tr("Could not delete file record %1 from local DB").arg(_item->_originalFile));
+ return;
+ }
+
propagator()->_journal->commit("Remote Remove");
done(SyncFileItem::Success);
const auto nestedItem = _nestedItems.take(encryptedFileName);
if (nestedItem.isValid()) {
- _propagator->_journal->deleteFileRecord(nestedItem._path, nestedItem._type == ItemTypeDirectory);
+ if (!_propagator->_journal->deleteFileRecord(nestedItem._path, nestedItem._type == ItemTypeDirectory)) {
+ qCWarning(PROPAGATE_REMOVE_ENCRYPTED_ROOTFOLDER) << "Failed to delete file record from local DB" << nestedItem._path;
+ }
_propagator->_journal->commit("Remote Remove");
}
}
// Delete old db data.
if (!propagator()->_journal->deleteFileRecord(_item->_originalFile)) {
qCWarning(lcPropagateRemoteMove) << "could not delete file from local DB" << _item->_originalFile;
- done(SyncFileItem::NormalError, tr("could not delete file %1 from local DB").arg(_item->_originalFile));
+ done(SyncFileItem::NormalError, tr("Could not delete file record %1 from local DB").arg(_item->_originalFile));
return;
}
if (!vfs->setPinState(_item->_originalFile, PinState::Inherited)) {
propagator()->reportProgress(*_item, 0);
if (!propagator()->_journal->deleteFileRecord(_item->_originalFile, _item->isDirectory())) {
qCWarning(lcPropagateLocalRename) << "could not delete file from local DB" << _item->_originalFile;
- done(SyncFileItem::NormalError, tr("could not delete file %1 from local DB").arg(_item->_originalFile));
+ done(SyncFileItem::NormalError, tr("Could not delete file record %1 from local DB").arg(_item->_originalFile));
return;
}
propagator()->_journal->commit("Local remove");
}
if (!propagator()->_journal->deleteFileRecord(_item->_originalFile)) {
qCWarning(lcPropagateLocalRename) << "could not delete file from local DB" << _item->_originalFile;
- done(SyncFileItem::NormalError, tr("could not delete file %1 from local DB").arg(_item->_originalFile));
+ done(SyncFileItem::NormalError, tr("Could not delete file record %1 from local DB").arg(_item->_originalFile));
return;
}