Make settings iterate from root, hide settings from user
This commit is contained in:
parent
7a57d7b0c4
commit
d7cae8e32e
@ -51,9 +51,8 @@ func (p *provider) ProvideIds(tr objecttree.ObjectTree, startId string) (ids []s
|
||||
}
|
||||
|
||||
if startId == "" {
|
||||
err = tr.IterateFrom(tr.Id(), convert, process)
|
||||
} else {
|
||||
err = tr.IterateFrom(startId, convert, process)
|
||||
startId = rootId
|
||||
}
|
||||
err = tr.IterateFrom(startId, convert, process)
|
||||
return
|
||||
}
|
||||
|
||||
@ -78,8 +78,7 @@ func TestProvider_ProvideIds(t *testing.T) {
|
||||
t.Run("startId is empty", func(t *testing.T) {
|
||||
ch := &objecttree.Change{Id: "rootId"}
|
||||
objTree.EXPECT().Root().Return(ch)
|
||||
objTree.EXPECT().Id().Return("id")
|
||||
objTree.EXPECT().IterateFrom("id", gomock.Any(), gomock.Any()).Return(nil)
|
||||
objTree.EXPECT().IterateFrom("rootId", gomock.Any(), gomock.Any()).Return(nil)
|
||||
_, _, err := prov.ProvideIds(objTree, "")
|
||||
require.NoError(t, err)
|
||||
})
|
||||
|
||||
@ -24,6 +24,7 @@ import (
|
||||
"github.com/anytypeio/any-sync/nodeconf"
|
||||
"github.com/anytypeio/any-sync/util/keys/asymmetric/encryptionkey"
|
||||
"github.com/anytypeio/any-sync/util/keys/asymmetric/signingkey"
|
||||
"github.com/anytypeio/any-sync/util/slice"
|
||||
"github.com/zeebo/errs"
|
||||
"go.uber.org/zap"
|
||||
"strconv"
|
||||
@ -228,7 +229,9 @@ func (s *space) Storage() spacestorage.SpaceStorage {
|
||||
}
|
||||
|
||||
func (s *space) StoredIds() []string {
|
||||
return s.headSync.AllIds()
|
||||
return slice.DiscardFromSlice(s.headSync.AllIds(), func(id string) bool {
|
||||
return id == s.settingsObject.Id()
|
||||
})
|
||||
}
|
||||
|
||||
func (s *space) DebugAllHeads() []headsync.TreeHeads {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user