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

Ignore Stray Public Shares #1090

Merged
merged 3 commits into from
Aug 13, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions changelog/unreleased/ignore-stray-public-shares.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Ensure ignoring public stray shares

When using the json public shares manager, it can be the case we found a share with a resource_id that no longer exists.

https://github.com/cs3org/reva/pull/1090
Original file line number Diff line number Diff line change
Expand Up @@ -1162,14 +1162,14 @@ func (h *Handler) listPublicShares(r *http.Request, filters []*link.ListPublicSh
}

statResponse, err := c.Stat(ctx, statRequest)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should keep detecting grpc call errors and returning nil, err

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree 👍

return nil, err
if statResponse.Status.Code != rpc.Code_CODE_OK {
if statResponse.Status.Code == rpc.Code_CODE_NOT_FOUND {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is status code is neither or nor not found, should still return nil, err, might need to format that error

// TODO share target was not found, we should not error here.
continue
}
}

sData := conversions.PublicShare2ShareData(share, r, h.publicURL)
if statResponse.Status.Code != rpc.Code_CODE_OK {
return nil, err
}

sData.Name = share.DisplayName

Expand Down