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

sharestorageprovider: Stat resource when resolving share by path #4561

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

rhafer
Copy link
Contributor

@rhafer rhafer commented Mar 6, 2024

When resolving a received shared by mountpath, make sure that the shared resource actually exists. This avoids issues with dangling shares for already delete resources using the same mountpoint.

Fixes: owncloud/ocis#7895

We're already using a State based filter in the ListReceivedShares request.
No need to manually check for that again.
@rhafer rhafer self-assigned this Mar 6, 2024
When resolving a received shared by mountpath, make sure that the
shared resource actually exists. This avoids issues with dangling shares
for already delete resources using the same mountpoint.

Fixes: owncloud/ocis#7895
rhafer added a commit to rhafer/ocis that referenced this pull request Mar 6, 2024
@rhafer rhafer marked this pull request as ready for review March 6, 2024 14:09
@rhafer rhafer requested review from labkode, glpatcern and a team as code owners March 6, 2024 14:09
@rhafer rhafer requested review from kobergj and 2403905 March 6, 2024 14:09
@@ -261,7 +261,23 @@ var _ = Describe("Sharesstorageprovider", func() {
},
}
default:
if req.Ref.ResourceId.OpaqueId == "shareddir-merged" {
switch req.Ref.ResourceId.OpaqueId {
case "shareddir", "shareddir2":
Copy link

Choose a reason for hiding this comment

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

Do we need to provide the constants for the "shareddir", "shareddir2", "shareddir-merged"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking at the surrounding code, especially the outer switch statement, I'd say: no 😃

More seriously I guess the mocks could benefit from some refactoring, but I think the string constants are the least of on an issue.

@rhafer rhafer merged commit fa2caba into cs3org:edge Mar 7, 2024
9 checks passed
rhafer added a commit to rhafer/ocis that referenced this pull request Mar 7, 2024
rhafer added a commit to rhafer/ocis that referenced this pull request Mar 7, 2024
@micbar micbar mentioned this pull request Mar 13, 2024
71 tasks
@micbar micbar mentioned this pull request Jun 19, 2024
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants