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

[QA] moving a folder containing a received share into another received share breaks apart #39000

Open
jnweiger opened this issue Jul 14, 2021 · 6 comments
Labels

Comments

@jnweiger
Copy link
Contributor

Seen with oc 10.8.0-beta2 while testing #38767

  • admin creates "folder1/path/to/file.txt" and "folder2/pot/too/fool.txt"
  • admins shares "folder1" and "folder2" with user1.
  • user1 moves "folder2" (shared) into "folder1 (shared)"
  • Move is prevented and no file scan happens. -> The move is expected to fail. The proper error message appears:
    Could not move "folder2": There was an error while renaming the file or directory
  • user1 also has a (not shared) folder Documents. user1 moves folder2 into Documents,
  • user1 moves Documents into folder1. -> No error message appears. BAD
  • the user interface indicates that the entire hierarchy of Documents was moved into folder1, this is not true. BAD
  • in reality (seen after a shift reload) user1 can see, that folder2 appears on toplevel, (next to folder1) while Documents was indeed moved into folder1

Expected behaviour:

  • The same error message appears, as if directly trying to move folder2 into folder1
  • the UI indicates shows the resulting folder structure immediately (no need for shift reload)
@jnweiger
Copy link
Contributor Author

@pmaier1

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

@github-actions
Copy link

This issue has been automatically closed.

@phil-davis
Copy link
Contributor

PR #39724 adds some test scenarios to demonstrate some variations of moving shares similar to the scenario described here.

@phil-davis
Copy link
Contributor

The interesting scenario is:

  Background:
    Given using OCS API version "1"
    And these users have been created with default attributes and without skeleton files:
      | username |
      | Alice    |
      | Brian    |
    And user "Alice" has created folder "folderA"
    And user "Alice" has created folder "folderB"
    And user "Alice" has uploaded file with content "text A" to "/folderA/fileA.txt"
    And user "Alice" has uploaded file with content "text B" to "/folderB/fileB.txt"
    And user "Alice" has shared folder "folderA" with user "Brian"
    And user "Alice" has shared folder "folderB" with user "Brian"

  Scenario: share receiver moves a whole share inside a local folder then moves the local folder inside a received share
    Given user "Brian" has created folder "localFolder"
    And user "Brian" has uploaded file with content "local text" to "/localFolder/localFile.txt"
    When user "Brian" moves folder "folderB" to "localFolder/folderB" using the WebDAV API
    And user "Brian" moves folder "localFolder" to "folderA/localFolder" using the WebDAV API
    Then the HTTP status code should be "201"
    And as "Alice" folder "/folderA/localFolder" should exist
    And as "Brian" folder "/folderA/localFolder" should exist
    And as "Alice" file "/folderA/localFolder/localFile.txt" should exist
    And as "Brian" file "/folderA/localFolder/localFile.txt" should exist
    # folderB now exists separately, and is no longer inside localFolder
    And as "Alice" file "/folderB/fileB.txt" should exist
    And as "Brian" file "/folderB/fileB.txt" should exist
    But as "Alice" folder "/folderA/localFolder/folderB" should not exist
    And as "Brian" folder "/folderA/localFolder/folderB" should not exist

Brian moved folderB into localFolder
Then Brian moved localFolder into folderA

That move happened - folderA/localFolder/localFile.txt exists, which is good.

localFolder/folderB does not get moved to folderA/localFolder/folderB (that would have put folderB inside folderA)
folderB goes back to being "out by itself", no longer inside localFolder

Maybe this is a reasonable thing to do? And so, maybe the server behaves "as it should"?

But I guess it will be a bit surprising to Brian - when Brian goes looking in folderA/localFolder he sees localFile.txt but will wonder what happened to folderB

What should the server do when it receives a move request like this?

@phil-davis
Copy link
Contributor

Some automated API tests are running in both oC10 and oCIS. They demonstrate the existing behavior, and what I think is the "reasonable" desired behavior on oCIS.

https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToRoot/moveShareInsideAnotherShare.feature

https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/moveShareInsideAnotherShare.feature

Somebody can look at those scenarios and decide if the requirements are something different, and we can adjust the scenarios. And then a developer can adjust the code...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants