fix(model): don't clobber local flags when receiving index (#10190)

This commit is contained in:
Jakob Borg
2025-06-20 07:08:06 +00:00
committed by GitHub
parent 4c64843d60
commit c5a29b5b26
4 changed files with 19 additions and 6 deletions
-5
View File
@@ -421,11 +421,6 @@ func (s *indexHandler) receive(fs []protocol.FileInfo, update bool, op string, p
"precedingSeq": fs[i-1].Sequence,
})
}
// The local attributes should never be transmitted over the wire.
// Make sure they look like they weren't.
fs[i].LocalFlags = 0
fs[i].VersionHash = nil
}
// Verify the claimed last sequence number
+1
View File
@@ -3498,6 +3498,7 @@ func TestScanDeletedROChangedOnSR(t *testing.T) {
}
// A remote must have the file, otherwise the deletion below is
// automatically resolved as not a ro-changed item.
file.LocalFlags = 0 // clear as we're skipping the code path where it would otherwise be cleared naturally
must(t, m.IndexUpdate(conn, &protocol.IndexUpdate{Folder: fcfg.ID, Files: []protocol.FileInfo{file}}))
must(t, ffs.Remove(name))