X Tutup
Skip to content

Handle mountpoint collisions for different providers#35319

Closed
VicDeo wants to merge 4 commits intomasterfrom
fix-35154
Closed

Handle mountpoint collisions for different providers#35319
VicDeo wants to merge 4 commits intomasterfrom
fix-35154

Conversation

@VicDeo
Copy link
Member

@VicDeo VicDeo commented May 23, 2019

Description

Check that all user mount points has unique names

Related Issue

Motivation and Context

invisible local share when federated share with the same name exists

How Has This Been Tested?

  1. install two servers with owncloud and configure federation sharing for me http://localhost/owncloud-10.2.0/rc2_a & http://localhost/owncloud-10.2.0/rc2_b
  2. on server A create a user user1_on_server_a
  3. on server B create two users user1_on_server_b user2_on_server_b
  4. as user1_on_server_a create a folder called to-share
  5. as user1_on_server_a share the folder to-share with user1_on_server_b via federation sharing
  6. as user1_on_server_b accept the share
  7. as user2_on_server_b create a folder called to-share
  8. as user2_on_server_b share the folder to-share locally with user1_on_server_b

Expected behaviour

as user1_on_server_b there should be a received folder called to-share (fed sharing) and a folder called to share (2) local sharing

Actual behaviour

as user1_on_server_b there is only one received folder called to-share (fed sharing) and NO folder called to share (2) local sharing

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Backport (if applicable set "backport-request" label and remove when the backport was done)

@VicDeo VicDeo added this to the development milestone May 23, 2019
@VicDeo VicDeo self-assigned this May 23, 2019
@codecov
Copy link

codecov bot commented May 23, 2019

Codecov Report

Merging #35319 into master will decrease coverage by 16.72%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #35319       +/-   ##
=============================================
- Coverage     65.81%   49.09%   -16.73%     
=============================================
  Files          1228      109     -1119     
  Lines         70982    10535    -60447     
  Branches       1289     1289               
=============================================
- Hits          46716     5172    -41544     
+ Misses        23888     4985    -18903     
  Partials        378      378
Flag Coverage Δ Complexity Δ
#javascript 53.7% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 38.78% <ø> (-28.42%) 0 <ø> (-18818)
Impacted Files Coverage Δ Complexity Δ
lib/private/Files/Storage/DAV.php 59.45% <0%> (-21.64%) 0% <0%> (ø)
apps/updatenotification/templates/admin.php
lib/private/Encryption/Keys/Storage.php
lib/private/App/CodeChecker/NodeVisitor.php
lib/private/RedisFactory.php
apps/dav/lib/Avatars/AvatarNode.php
...s/dav/appinfo/Migrations/Version20170202213905.php
apps/dav/lib/Upload/ChunkLocationProvider.php
apps/files/lib/AppInfo/Application.php
apps/systemtags/list.php
... and 1108 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f52c8bd...b8053a7. Read the comment docs.

@VicDeo
Copy link
Member Author

VicDeo commented May 24, 2019

Well, there are existing tests that assume there could be shares with the same mount points.
😮

@owncloud owncloud deleted a comment from codecov bot Jun 3, 2019
@VicDeo VicDeo force-pushed the fix-35154 branch 2 times, most recently from b9bb686 to 60d348b Compare June 6, 2019 14:19
@micbar
Copy link
Contributor

micbar commented Jun 14, 2019

@VicDeo What are the next steps on this?
Do you need a review?

@VicDeo
Copy link
Member Author

VicDeo commented Jun 14, 2019

@micbar I'm stuck here. No idea how to fix the tests

@micbar
Copy link
Contributor

micbar commented Jun 17, 2019

@phil-davis @individual-it Could you help with the tests?

@phil-davis
Copy link
Contributor

@micbar the acceptance tests are passing. Various unit tests are failing e.g. https://drone.owncloud.com/owncloud/core/18094/127

here were 83 errors:

1) OCA\Files_Sharing\Tests\UpdaterTest::testShareFile with data set #0 ('/')
Error: Call to a member function getShare() on null

We can have a look, however it will be some learning to understand what is going on in the unit tests here (which might be "a good thing")

@micbar
Copy link
Contributor

micbar commented Jul 1, 2019

@patrickjahns Could you help here with testing issues?

@VicDeo
Copy link
Member Author

VicDeo commented Jul 2, 2019

This solution causes 53 existing test cases to fail because they are not true unit tests. These tests have external dependencies :/
I'm not sure how to proceed here...

@VicDeo
Copy link
Member Author

VicDeo commented Jul 2, 2019

it;s even more interesting.
MountProviderCollection::getMountsForUser has two identical sets of shares from different providers. Let me check...

@VicDeo
Copy link
Member Author

VicDeo commented Jul 2, 2019

can of worms opened :)
3 and 6
4 and 7
are the same mount providers 😷
mount providers

@VicDeo
Copy link
Member Author

VicDeo commented Jul 2, 2019

I've added a static property to register files_sharing mount providers only once.
But we might want to block duplication on MountProviderCollection level.
This will also speed up FS initialization a bit.

@VicDeo VicDeo force-pushed the fix-35154 branch 2 times, most recently from c82776f to 5d030d9 Compare July 4, 2019 12:50
@micbar micbar requested a review from patrickjahns July 9, 2019 18:57
@individual-it
Copy link
Member

individual-it commented Jul 18, 2019

with this change I have two folders as receiver, but the remote share (that was received firsts) is renamed to xx (2) the local share (that was received last) keeps its original name

tests to demonstrate the issue were added in #35870
after that test PR is merged, please rebase this PR. After fixing the issue the current tests will fail and will have to be adjusted according to the comments in the feature file

@individual-it
Copy link
Member

took off QA-team label because tests were implemented

@DeepDiver1975
Copy link
Member

As discussed in #35777 the master branch will from now on hold the ownCloud 10 codebase.

This PR targetted ownCloud 11 which is postponed to a far distant future.

Because of that I'm closing this PR and kindly ask you to re-submit this PR in a few days.

Thanks a lot for your patience

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

receiving a local share is not possible when a federation share with same name was received before

6 participants

X Tutup