Fix some bugs
This commit is contained in:
parent
2940519b5f
commit
f15c806415
@ -120,3 +120,4 @@ graph:
|
||||
maybeHeads:
|
||||
- A.1.3
|
||||
- B.1.2
|
||||
|
||||
|
||||
@ -26,9 +26,11 @@ type Keychain struct {
|
||||
func NewKeychain() *Keychain {
|
||||
return &Keychain{
|
||||
SigningKeys: map[string]threadmodels.SigningPrivKey{},
|
||||
SigningKeysByIdentity: map[string]threadmodels.SigningPrivKey{},
|
||||
EncryptionKeys: map[string]threadmodels.EncryptionPrivKey{},
|
||||
GeneratedIdentities: map[string]string{},
|
||||
ReadKeys: map[string]*SymKey{},
|
||||
ReadKeysByHash: map[uint64]*SymKey{},
|
||||
coder: threadmodels.NewEd25519Decoder(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,6 +9,8 @@ package threadbuilder
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/anytypeio/go-anytype-infrastructure-experiments/data/pb"
|
||||
"github.com/gogo/protobuf/proto"
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
@ -42,7 +44,13 @@ func (t *ThreadBuilder) Graph() (string, error) {
|
||||
|
||||
var chSymbs []string
|
||||
if r.changesDataDecrypted != nil {
|
||||
for _, chc := range r.changesDataDecrypted.Content {
|
||||
res := &pb.PlainTextChangeData{}
|
||||
err := proto.Unmarshal(r.changesDataDecrypted, res)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, chc := range res.Content {
|
||||
tp := fmt.Sprintf("%T", chc.Value)
|
||||
tp = strings.Replace(tp, "ChangeContentValueOf", "", 1)
|
||||
res := ""
|
||||
|
||||
@ -44,7 +44,7 @@ func (tb *TreeBuilder) Init() {
|
||||
}
|
||||
|
||||
func (tb *TreeBuilder) Build(fromStart bool) (*Tree, error) {
|
||||
heads := tb.thread.Heads()
|
||||
heads := tb.thread.MaybeHeads()
|
||||
|
||||
if fromStart {
|
||||
if err := tb.buildTreeFromStart(heads); err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user