-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
SharedStorage to new sharing code + cleanup #23919
Conversation
By analyzing the blame information on this pull request, we identified @icewind1991, @MTGap and @schiesbn to be potential reviewers |
@@ -42,7 +42,7 @@ class SharedScanner extends Scanner { | |||
*/ | |||
public function getData($path) { | |||
$data = parent::getData($path); | |||
$sourcePath = $this->storage->getSourcePath($path); | |||
$sourcePath = '/' . $this->storage->getOwner($path) . '/' . $this->storage->getSourcePath($path); |
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.
This needs to be handled cleaner
9aba49c
to
4827c43
Compare
60a523f
to
c57234a
Compare
e45ffa4
to
f10bec3
Compare
Ok all seems well. Commits are reorderd and squashed. @nickvergessen could you see if activities and admin_audit still behave as expected? Please review: @icewind1991 @PVince81 @MorrisJobke @DeepDiver1975 |
if ($data === null) { | ||
return null; | ||
} | ||
$sourcePath = '/' . $this->storage->getOwner($path) . '/' . $this->storage->getSourcePath($path); |
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.
I think this only works for the home storage.
Also it shouldn't be needed, you can get $sourceStorage
and $internalPath
from the storage without first going trough the absolute path
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.
yes you are right. let me see if I can fix that a bit cleaner
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.
A fixed $storage->resolvePath
is what you want
f10bec3
to
b2dfc46
Compare
c6b8d95
to
531f7cb
Compare
531f7cb
to
8ad4335
Compare
@@ -102,4 +102,8 @@ protected function formatCacheEntry($entry) { | |||
public function clear() { | |||
// Not a valid action for Shared Cache | |||
} | |||
|
|||
public function moveFromCache(\OCP\Files\Cache\ICache $sourceCache, $sourcePath, $targetPath) { | |||
parent::moveFromCache($sourceCache, $sourcePath, $this->storage->getSourcePath($targetPath)); |
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.
was this missing in the past ? Or is this addition specific to this PR's changes ?
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.
In the past we used the parents function. but now we can't directly because we need to translate the path first.
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.
This should be moved to CacheJail
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.
No. Because in the cache jail we don't that it is a shared storage. So we don't know that it has getSourcePath
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.
UHm I mean a jail storage...
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.
Or... can we assume that the storage of a cachejail is always a jail?
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.
CacheJail
has it's own getSourcePath
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.
O stupid me. Ok will fix.
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.
Ok moved.
admin_audit and activity still work |
* @return bool | ||
*/ | ||
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) { | ||
return parent::moveFromStorage($sourceStorage, $sourceInternalPath, $this->getSourcePath($targetInternalPath)); |
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.
These can also be moved to the parent
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.
moved
Code looks good otherwise |
8ad4335
to
ff3ffc3
Compare
ff3ffc3
to
b53d659
Compare
👍 |
I can't judge on the code, but the sharing still works fine (federated shares, link shares, internal shares) So here is my 👍 |
*/ | ||
public function getStorageId() { | ||
if (!$this->storageId) { | ||
$this->storageId = $this->mount->getStorage()->getStorageCache()->getNumericId(); |
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.
what is this actually done for, the value seems unused? should it be returned?
Regression: #25186 |
Partial backport (well, only a very small part) to stable9: #25360 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
For #22209
This (big) PR will move the sharedstorage over to the share manager. Since this is not a 1 on 1 transformation this will cleanup the shared storage (and simplify it!) as well.
TODO:
CC: @icewind1991