Skip to content

Commit

Permalink
fix bug when deletion timestamp is missing
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Richter <crichter@owncloud.com>
  • Loading branch information
dragonchaser committed Feb 21, 2024
1 parent afaa3bf commit 3cf3e5c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/storage/utils/decomposedfs/tree/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -631,14 +631,15 @@ func (t *Tree) PurgeRecycleItemFunc(ctx context.Context, spaceid, key string, pa
return nil, nil, err
}

ts := ""
timeSuffix := strings.SplitN(filepath.Base(deletedNodePath), node.TrashIDDelimiter, 2)
if len(timeSuffix) != 2 {
return nil, nil, errtypes.InternalError("invalid trash path")
if len(timeSuffix) == 2 {
ts = timeSuffix[1]
}

fn := func() error {

if err := t.removeNode(ctx, deletedNodePath, timeSuffix[1], rn); err != nil {
if err := t.removeNode(ctx, deletedNodePath, ts, rn); err != nil {
return err
}

Expand Down

0 comments on commit 3cf3e5c

Please sign in to comment.