mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-12 10:40:55 +09:00
GO-3531: Files: fix deleting of broken files
This commit is contained in:
parent
629af192c4
commit
17625e94e2
1 changed files with 3 additions and 1 deletions
|
@ -2,11 +2,13 @@ package block
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/anyproto/anytype-heart/core/block/editor/smartblock"
|
||||
"github.com/anyproto/anytype-heart/core/domain"
|
||||
"github.com/anyproto/anytype-heart/core/event"
|
||||
"github.com/anyproto/anytype-heart/core/files/fileobject"
|
||||
"github.com/anyproto/anytype-heart/pb"
|
||||
"github.com/anyproto/anytype-heart/pkg/lib/bundle"
|
||||
coresb "github.com/anyproto/anytype-heart/pkg/lib/core/smartblock"
|
||||
|
@ -42,7 +44,7 @@ func (s *Service) DeleteObjectByFullID(id domain.FullID) error {
|
|||
return fmt.Errorf("subobjects deprecated")
|
||||
case coresb.SmartBlockTypeFileObject:
|
||||
err = s.fileObjectService.DeleteFileData(id.ObjectID)
|
||||
if err != nil {
|
||||
if err != nil && !errors.Is(err, fileobject.ErrEmptyFileId) {
|
||||
return fmt.Errorf("delete file data: %w", err)
|
||||
}
|
||||
err = spc.DeleteTree(context.Background(), id.ObjectID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue