1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

Fix deletion check

This commit is contained in:
mcrakhman 2024-10-24 08:28:36 +02:00
parent c9bf97f31c
commit fdbd3d0982
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
2 changed files with 5 additions and 0 deletions

View file

@ -732,6 +732,9 @@ func (ot *objectTree) ChangesAfterCommonSnapshot(theirPath, theirHeads []string)
}
func (ot *objectTree) ChangesAfterCommonSnapshotLoader(theirPath, theirHeads []string) (LoadIterator, error) {
if ot.isDeleted {
return nil, ErrDeleted
}
var (
needFullDocument = len(theirPath) == 0
ourPath = ot.SnapshotPath()

View file

@ -246,6 +246,8 @@ func TestObjectTree(t *testing.T) {
require.NoError(t, err)
_, err = aTree.ChangesAfterCommonSnapshot(nil, nil)
require.Equal(t, ErrDeleted, err)
_, err = aTree.ChangesAfterCommonSnapshotLoader(nil, nil)
require.Equal(t, ErrDeleted, err)
err = aTree.IterateFrom("", nil, func(change *Change) bool {
return true
})