Skip to content

Commit

Permalink
Ignore Stray Public Shares (#1090)
Browse files Browse the repository at this point in the history
  • Loading branch information
refs authored Aug 13, 2020
1 parent 1b82c12 commit baea1c6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
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 @@ -1165,12 +1165,16 @@ func (h *Handler) listPublicShares(r *http.Request, filters []*link.ListPublicSh
if err != nil {
return nil, err
}

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

return nil, errors.New(fmt.Sprintf("could not stat share target: %v, code: %v", share.ResourceId, statResponse.Status))
}

sData := conversions.PublicShare2ShareData(share, r, h.publicURL)

sData.Name = share.DisplayName

if h.addFileInfo(ctx, sData, statResponse.Info) != nil {
Expand Down

0 comments on commit baea1c6

Please sign in to comment.