Skip to content

Commit

Permalink
Return an error when EOS returns an error in List (#5044)
Browse files Browse the repository at this point in the history
Co-authored-by: Jesse Geens <[email protected]>
  • Loading branch information
jessegeens and Jesse Geens authored Jan 17, 2025
1 parent 6ad3fe0 commit 51e12b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/return-err-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Return an error when EOS List errors

If we get an error while reading items, we now return the error to the user and break off the List operation
We do not want to return a partial list, because then a sync client may delete local files that are missing on the server

https://github.com/cs3org/reva/pull/5044
6 changes: 3 additions & 3 deletions pkg/eosclient/eosgrpc/eosgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -1259,12 +1259,12 @@ func (c *Client) List(ctx context.Context, auth eosclient.Authorization, dpath s
break
}

// We got an error while reading items. We log this as an error and we return
// the items we have
// We got an error while reading items. We return the error to the user and break off the List operation
// We do not want to return a partial list, because then a sync client may delete local files that are missing on the server
log.Error().Err(err).Str("func", "List").Int("nitems", i).Str("path", dpath).Str("got err from EOS", err.Error()).Msg("")
if i > 0 {
log.Error().Str("path", dpath).Int("nitems", i).Msg("No more items, dirty exit")
return mylst, nil
return nil, errors.Wrap(err, "Error listing files")
}
}

Expand Down

0 comments on commit 51e12b4

Please sign in to comment.