Skip to content

Commit 0d6a39c

Browse files
Merge pull request #1891 from anyproto/go-4261-add-progress-bar-for-space-loading
GO-4261: enable sync status fixes
2 parents f505503 + b7097b8 commit 0d6a39c

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

core/indexer/reindex_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ func TestReindex_addSyncRelations(t *testing.T) {
319319
fx.sourceFx.EXPECT().IDsListerBySmartblockType(space1, coresb.SmartBlockTypeProfilePage).Return(idsLister{Ids: []string{}}, nil)
320320
fx.sourceFx.EXPECT().IDsListerBySmartblockType(space1, coresb.SmartBlockTypeChatDerivedObject).Return(idsLister{Ids: []string{}}, nil)
321321
fx.sourceFx.EXPECT().IDsListerBySmartblockType(space1, coresb.SmartBlockTypeChatObject).Return(idsLister{Ids: []string{}}, nil)
322+
fx.sourceFx.EXPECT().IDsListerBySmartblockType(space1, coresb.SmartBlockTypeSpaceView).Return(idsLister{Ids: []string{}}, nil)
322323

323324
space1.EXPECT().DoLockedIfNotExists("1", mock.AnythingOfType("func() error")).Return(nil)
324325
space1.EXPECT().DoLockedIfNotExists("2", mock.AnythingOfType("func() error")).Return(nil)
@@ -358,6 +359,7 @@ func TestReindex_addSyncRelations(t *testing.T) {
358359
fx.sourceFx.EXPECT().IDsListerBySmartblockType(space1, coresb.SmartBlockTypeProfilePage).Return(idsLister{Ids: []string{}}, nil)
359360
fx.sourceFx.EXPECT().IDsListerBySmartblockType(space1, coresb.SmartBlockTypeChatDerivedObject).Return(idsLister{Ids: []string{}}, nil)
360361
fx.sourceFx.EXPECT().IDsListerBySmartblockType(space1, coresb.SmartBlockTypeChatObject).Return(idsLister{Ids: []string{}}, nil)
362+
fx.sourceFx.EXPECT().IDsListerBySmartblockType(space1, coresb.SmartBlockTypeSpaceView).Return(idsLister{Ids: []string{}}, nil)
361363

362364
space1.EXPECT().DoLockedIfNotExists("1", mock.AnythingOfType("func() error")).Return(nil)
363365
space1.EXPECT().DoLockedIfNotExists("2", mock.AnythingOfType("func() error")).Return(nil)

core/syncstatus/detailsupdater/helper/helper.go

+1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ func SyncRelationsSmartblockTypes() []smartblock.SmartBlockType {
3737
smartblock.SmartBlockTypeProfilePage,
3838
smartblock.SmartBlockTypeChatDerivedObject,
3939
smartblock.SmartBlockTypeChatObject,
40+
smartblock.SmartBlockTypeSpaceView,
4041
}
4142
}

core/syncstatus/detailsupdater/updater.go

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package detailsupdater
33
import (
44
"context"
55
"errors"
6+
"slices"
67
"sync"
78
"time"
89

@@ -13,6 +14,7 @@ import (
1314

1415
"github.com/anyproto/anytype-heart/core/block/editor/smartblock"
1516
"github.com/anyproto/anytype-heart/core/domain"
17+
"github.com/anyproto/anytype-heart/core/syncstatus/detailsupdater/helper"
1618
"github.com/anyproto/anytype-heart/core/syncstatus/filesyncstatus"
1719
"github.com/anyproto/anytype-heart/core/syncstatus/syncsubscriptions"
1820
"github.com/anyproto/anytype-heart/pkg/lib/bundle"
@@ -222,6 +224,9 @@ func (u *syncStatusUpdater) updateObjectDetails(syncStatusDetails *syncStatusDet
222224
}
223225

224226
func (u *syncStatusUpdater) setSyncDetails(sb smartblock.SmartBlock, status domain.ObjectSyncStatus, syncError domain.SyncError) error {
227+
if !slices.Contains(helper.SyncRelationsSmartblockTypes(), sb.Type()) {
228+
return nil
229+
}
225230
st := sb.NewState()
226231
if !u.isLayoutSuitableForSyncRelations(sb.Details()) {
227232
return nil

0 commit comments

Comments
 (0)