mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-09 09:35:00 +09:00
GO-5105 Merge branch 'GO-4146-new-spacestore' of github.com:anyproto/anytype-heart into go-5105-check-and-fix-problem-with-new-store
This commit is contained in:
commit
3938529b0c
192 changed files with 12682 additions and 7060 deletions
|
@ -4,8 +4,10 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/anyproto/anytype-heart/core/domain"
|
||||
"github.com/anyproto/anytype-heart/pb"
|
||||
"github.com/anyproto/anytype-heart/pkg/lib/bundle"
|
||||
"github.com/anyproto/anytype-heart/pkg/lib/localstore/addr"
|
||||
|
@ -45,9 +47,12 @@ func collectInfoFromDetails(s *pb.SnapshotWithType, info *useCaseInfo) {
|
|||
cr.isUsed = true
|
||||
info.customTypesAndRelations[k] = cr
|
||||
}
|
||||
values := pbtypes.GetStringListValue(v)
|
||||
for _, val := range values {
|
||||
if k == bundle.RelationKeyRecommendedRelations.String() {
|
||||
if slices.Contains([]domain.RelationKey{
|
||||
bundle.RelationKeyRecommendedRelations, bundle.RelationKeyRecommendedFeaturedRelations,
|
||||
bundle.RelationKeyRecommendedHiddenRelations, bundle.RelationKeyRecommendedFileRelations,
|
||||
}, domain.RelationKey(k)) {
|
||||
values := pbtypes.GetStringListValue(v)
|
||||
for _, val := range values {
|
||||
if key, found := info.relations[val]; found {
|
||||
if cr, foundToo := info.customTypesAndRelations[string(key)]; foundToo {
|
||||
cr.isUsed = true
|
||||
|
|
|
@ -141,11 +141,6 @@ func validateDetails(s *pb.SnapshotWithType, info *useCaseInfo) (err error) {
|
|||
fmt.Println("WARNING: object", id, "is a template with no target type included in the archive, so it will be skipped")
|
||||
return errSkipObject
|
||||
}
|
||||
if k == bundle.RelationKeyRecommendedRelations.String() {
|
||||
// TODO: remove this fix as most of users should obtain version with fixed export of derived objects in GO-2821
|
||||
delete(s.Snapshot.Data.Details.Fields, bundle.RelationKeyRecommendedRelations.String())
|
||||
return nil
|
||||
}
|
||||
err = multierror.Append(err, fmt.Errorf("failed to find target id for detail '%s: %s' of object %s", k, val, id))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue