Document creation fixes

This commit is contained in:
mcrakhman 2022-10-19 17:59:12 +02:00 committed by Mikhail Iudin
parent 071d0800b7
commit 282ef17df3
No known key found for this signature in database
GPG Key ID: FAAAA8BAABDFF1C0
4 changed files with 21 additions and 3 deletions

View File

@ -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,
}

View File

@ -125,5 +125,5 @@ func (s *spaceStorage) StoredIds() (ids []string, err error) {
}
func (s *spaceStorage) Close() (err error) {
return s.objDb.Close()
return nil
}

View File

@ -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()
}

View File

@ -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