Skip to content

Commit

Permalink
Set modificationHappened to also depend on file size change
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Aug 7, 2023
1 parent 23f53cf commit e383140
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libsync/syncengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ void OCC::SyncEngine::slotItemDiscovered(const OCC::SyncFileItemPtr &item)
// mini-jobs later on, we just update metadata right now.

if (item->_direction == SyncFileItem::Down) {
auto modificationHappened = false;
auto modificationHappened = false; // Decides whether or not we modify file metadata
QString filePath = _localPath + item->_file;

// If the 'W' remote permission changed, update the local filesystem
Expand All @@ -369,6 +369,8 @@ void OCC::SyncEngine::slotItemDiscovered(const OCC::SyncFileItemPtr &item)
modificationHappened = FileSystem::setFileReadOnlyWeak(filePath, isReadOnly);
}

modificationHappened |= item->_size != prev._fileSize;

auto rec = item->toSyncJournalFileRecordWithInode(filePath);
if (rec._checksumHeader.isEmpty())
rec._checksumHeader = prev._checksumHeader;
Expand Down

0 comments on commit e383140

Please sign in to comment.