-
Notifications
You must be signed in to change notification settings - Fork 113
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
Ensure stray shares get ignored #1064
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
|
@@ -139,7 +158,8 @@ func (s *svc) InitiateFileDownload(ctx context.Context, req *provider.InitiateFi | |||
err := errtypes.PermissionDenied("gateway: cannot download share folder or share name: path=" + p) | |||
log.Err(err).Msg("gateway: error downloading") | |||
return &gateway.InitiateFileDownloadResponse{ | |||
Status: status.NewInvalidArg(ctx, "path points to share folder or share name"), | |||
// Status: status.NewInvalidArg(ctx, "path points to share folder or share name"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uncomment again ?
log.Err(err).Msg("gateway: error moving") | ||
p, st := s.getPath(ctx, req.Source) | ||
if st.Code != rpc.Code_CODE_OK { | ||
// log.Err(err).Msg("gateway: error moving") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stray comment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@refs Really nice change! One comment though.
Also, we should have this for public shares as well, as there we support sharing single files and in EOS, the ResourceID changes every time a file is edited, so there you get a lot of such errors. We'll start working on fixing that at the fs level next week.
}, nil | ||
} | ||
|
||
dp, err := s.getPath(ctx, req.Destination) | ||
if err != nil { | ||
log.Err(err).Msg("gateway: error moving") | ||
// log.Err(err).Msg("gateway: error moving") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obsolete, or need to be re-enabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obsolete
moving a file or folder via webDAV fails with:
|
indeed, Litmus failed here in #1068:
|
|
the list sharing endpoint should work: https://github.com/owncloud/core/pull/37754/files#diff-129a7916711570e3ddb2eb9f655ce577 |
|
.drone.yml
Outdated
@@ -342,9 +342,8 @@ steps: | |||
image: owncloudci/php:7.2 | |||
commands: | |||
- git clone -b master --depth=1 https://github.com/owncloud/testing.git /drone/src/tmp/testing | |||
- git clone -b master --single-branch --no-tags https://github.com/owncloud/core.git /drone/src/tmp/testrunner | |||
- git clone -b testFixOCISPR409 --single-branch --no-tags https://github.com/owncloud/core.git /drone/src/tmp/testrunner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use reva-tests
, see owncloud/core#37798
proposed fix: in owncloud.go's
|
While working on this we realized we're using |
Signed-off-by: A.Unger <zyxancf@gmail.com>
This reverts commit 8dc7c90.
@@ -84,7 +84,6 @@ Feature: sharing | |||
| 2 | 200 | | |||
|
|||
@issue-ocis-reva-372 @issue-ocis-reva-243 | |||
# after fixing all issues delete this Scenario and use the one from oC10 core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why deleting this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, got mixed up
@@ -912,3 +912,7 @@ apiWebdavUpload2/uploadFileUsingOldChunking.feature:98 | |||
apiWebdavUpload2/uploadFileUsingOldChunking.feature:99 | |||
apiWebdavUpload2/uploadFileUsingOldChunking.feature:100 | |||
apiWebdavUpload2/uploadFileUsingOldChunking.feature:101 | |||
# | |||
# https://github.com/owncloud/ocis-reva/issues/372 Listing shares via ocs API does not show path for parent folders | |||
apiShareManagementBasic/createShare.feature:269 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@toImplementOnOCIS
tag removed here owncloud/core#37809 maybe the commit id must be advanced
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this is not the same file as core, this is the local feature for reva.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even if we change anything in core this PR is still green, because we are already expecting the failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there was some testing confusion, but this now works as intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@refs A couple of comments.
@@ -1295,7 +1295,13 @@ func (h *Handler) listUserShares(r *http.Request, filters []*collaboration.ListS | |||
} | |||
|
|||
if statResponse.Status.Code != rpc.Code_CODE_OK { | |||
return nil, errors.New("could not stat share target") | |||
if statResponse.Status.Code == rpc.Code_CODE_NOT_FOUND { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add this in listPublicShares?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
totally. I'd get hands on it tomorrow morning first thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually giving this a second thought, as this PR has been messy enough with the testing I would like to create a new one for these changes and keep changes as "atomic" as possible. This PR is blocking us from finishing http://github.com/owncloud/ocis/pull/409 and the earlier we merge it the better 🙄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh okay. No worries then. I'll merge it
if res.Status.Code != rpc.Code_CODE_OK { | ||
err := status.NewErrorFromCode(res.Status.Code, "gateway") | ||
return "", err | ||
if (res != nil && res.Status.Code != rpc.Code_CODE_OK) || err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to check res != nil
? There might arise cases where we might have initialized it and then run into some error but returned it anyway.
Scope
JSON Shares Manager.
When using the json shares manager, it can be the case we found a share with a
resource_id
that no longer exists. This PR aims to address his case by changing the contract ofgetPath
and return the result of theSTAT
call instead of a generic error, so we can check the cause.This is by no means a perfect solution, but starts addressing the inconsistencies of the error handling across the code base.