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

GO-5611 fix load exit

This commit is contained in:
Roman Khafizianov 2025-05-09 15:32:17 +02:00
parent 86e4c3e0c1
commit b485c5438a
No known key found for this signature in database
GPG key ID: F07A7D55A2684852

View file

@ -107,14 +107,12 @@ func (ls *loadingSpace) load(ctx context.Context) (notRetryable bool) {
if err == nil {
err = sp.WaitMandatoryObjects(ctx)
if err != nil {
log.WarnCtx(ctx, "space load: mandatory objects error", zap.String("spaceId", ls.ID), zap.Error(err), zap.Bool("disableRemoteLoad", ls.disableRemoteLoad))
notRetryable = errors.Is(err, objecttree.ErrHasInvalidChanges)
log.WarnCtx(ctx, "space load: mandatory objects error", zap.String("spaceId", ls.ID), zap.Error(err), zap.Bool("disableRemoteLoad", ls.disableRemoteLoad), zap.Bool("notRetryable", notRetryable))
return ls.disableRemoteLoad || notRetryable
}
}
if err != nil {
log.WarnCtx(ctx, "space load: error", zap.String("spaceId", ls.ID), zap.Error(err), zap.Bool("disableRemoteLoad", ls.disableRemoteLoad))
if sp != nil {
closeErr := sp.Close(ctx)
if closeErr != nil {
@ -122,6 +120,13 @@ func (ls *loadingSpace) load(ctx context.Context) (notRetryable bool) {
}
}
ls.setLoadErr(err)
if errors.Is(err, context.Canceled) {
log.WarnCtx(ctx, "space load: error: context bug", zap.String("spaceId", ls.ID), zap.Error(err), zap.Bool("disableRemoteLoad", ls.disableRemoteLoad))
// hotfix for drpc bug
// todo: remove after https://github.com/anyproto/any-sync/pull/448 got integrated
return false
}
log.WarnCtx(ctx, "space load: error", zap.String("spaceId", ls.ID), zap.Error(err), zap.Bool("disableRemoteLoad", ls.disableRemoteLoad))
} else {
if ls.latestAclHeadId != "" && !ls.disableRemoteLoad {
acl := sp.CommonSpace().Acl()