1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-10 10:00:46 +09:00

builtinobjects import: preserve subobject ids

This commit is contained in:
Roman Khafizianov 2023-01-17 12:24:12 +01:00
parent f4548c12f5
commit 8cf8d3c3b8
No known key found for this signature in database
GPG key ID: F07A7D55A2684852

View file

@ -11,7 +11,6 @@ import (
"path/filepath"
"strings"
"github.com/globalsign/mgo/bson"
"github.com/gogo/protobuf/types"
"github.com/textileio/go-threads/core/thread"
@ -118,8 +117,8 @@ func (b *builtinObjects) inject(ctx context.Context) (err error) {
return err
}
if sbt == smartblock.SmartBlockTypeSubObject {
newId := bson.NewObjectId().Hex()
b.idsMap[id] = newId
// preserve original id for subobjects, it makes no sense to replace them and also it breaks the grouping
b.idsMap[id] = id
continue
}
tid, err := threads.ThreadCreateID(thread.AccessControlled, sbt)