Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return an error when EOS returns an error in List #5044

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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