diff --git a/client/storage/liststorage.go b/client/storage/liststorage.go index 3061eafd..3d784c31 100644 --- a/client/storage/liststorage.go +++ b/client/storage/liststorage.go @@ -37,7 +37,7 @@ func newListStorage(spaceId string, db *badger.DB, txn *badger.Txn) (ls storage. ls = &listStorage{ db: db, - keys: aclKeys{}, + keys: newACLKeys(spaceId), id: stringId, root: rootWithId, } @@ -70,7 +70,7 @@ func createListStorage(spaceId string, db *badger.DB, txn *badger.Txn, root *acl ls = &listStorage{ db: db, - keys: aclKeys{}, + keys: newACLKeys(spaceId), id: root.Id, root: root, } diff --git a/client/storage/spacestorage.go b/client/storage/spacestorage.go index c11f1846..f0b65045 100644 --- a/client/storage/spacestorage.go +++ b/client/storage/spacestorage.go @@ -125,5 +125,5 @@ func (s *spaceStorage) StoredIds() (ids []string, err error) { } func (s *spaceStorage) Close() (err error) { - return s.objDb.Close() + return nil } diff --git a/client/storage/storageservice.go b/client/storage/storageservice.go index 57a8cc11..43b9c6f4 100644 --- a/client/storage/storageservice.go +++ b/client/storage/storageservice.go @@ -1,6 +1,7 @@ package storage import ( + "context" "github.com/anytypeio/go-anytype-infrastructure-experiments/client/badgerprovider" "github.com/anytypeio/go-anytype-infrastructure-experiments/common/app" "github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/storage" @@ -14,6 +15,7 @@ type storageService struct { type ClientStorage interface { storage.SpaceStorageProvider + app.ComponentRunnable AllSpaceIds() (ids []string, err error) } @@ -62,3 +64,11 @@ func (s *storageService) AllSpaceIds() (ids []string, err error) { }) return } + +func (s *storageService) Run(ctx context.Context) (err error) { + return nil +} + +func (s *storageService) Close(ctx context.Context) (err error) { + return s.db.Close() +} diff --git a/common/commonspace/space.go b/common/commonspace/space.go index 57eedb75..02d41fa7 100644 --- a/common/commonspace/space.go +++ b/common/commonspace/space.go @@ -89,6 +89,14 @@ func (s *space) Init(ctx context.Context) (err error) { if err != nil { return } + aclStorage, err := s.storage.ACLStorage() + if err != nil { + return + } + s.aclList, err = list.BuildACLList(aclStorage) + if err != nil { + return + } s.diffService.Init(initialIds) s.syncService.Init() return nil