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

Prevent deletion for derived

This commit is contained in:
mcrakhman 2023-09-26 22:35:47 +02:00
parent 3608a6949f
commit 61bd9aae1e
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
6 changed files with 91 additions and 18 deletions

View file

@ -193,6 +193,19 @@ func TestObjectTree(t *testing.T) {
require.Equal(t, ErrDerived, err)
})
t.Run("derived root returns true", func(t *testing.T) {
root, err := DeriveObjectTreeRoot(ObjectTreeDerivePayload{
ChangeType: "changeType",
ChangePayload: nil,
SpaceId: "spaceId",
IsEncrypted: true,
}, aclList)
require.NoError(t, err)
isDerived, err := IsDerivedRoot(root)
require.NoError(t, err)
require.True(t, isDerived)
})
t.Run("derived more than 1 change, not snapshot, correct", func(t *testing.T) {
root, err := DeriveObjectTreeRoot(ObjectTreeDerivePayload{
ChangeType: "changeType",