mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix infinite loops with propagating etags on reshares
This commit is contained in:
parent
767ca44988
commit
7b70343dc3
2 changed files with 16 additions and 7 deletions
|
|
@ -133,8 +133,8 @@ class RecipientPropagator {
|
|||
$this->markDirty($share, microtime(true));
|
||||
|
||||
// propagate up the share tree
|
||||
$user = $share['uid_owner'];
|
||||
if($user !== $this->userId) {
|
||||
if ($share['share_with'] === $this->userId) {
|
||||
$user = $share['uid_owner'];
|
||||
$view = new View('/' . $user . '/files');
|
||||
$path = $view->getPath($share['file_source']);
|
||||
$watcher = new ChangeWatcher($view, $this->manager->getSharePropagator($user));
|
||||
|
|
|
|||
|
|
@ -266,15 +266,15 @@ class EtagPropagation extends TestCase {
|
|||
\OCP\Share::unshare(
|
||||
'folder',
|
||||
$folderId,
|
||||
\OCP\Share::SHARE_TYPE_USER,
|
||||
\OCP\Share::SHARE_TYPE_USER,
|
||||
self::TEST_FILES_SHARING_API_USER2
|
||||
)
|
||||
);
|
||||
$this->assertEtagsForFoldersChanged([
|
||||
// direct recipient affected
|
||||
self::TEST_FILES_SHARING_API_USER2,
|
||||
self::TEST_FILES_SHARING_API_USER2,
|
||||
// reshare recipient affected
|
||||
self::TEST_FILES_SHARING_API_USER4,
|
||||
self::TEST_FILES_SHARING_API_USER4,
|
||||
]);
|
||||
|
||||
$this->assertAllUnchaged();
|
||||
|
|
@ -287,9 +287,9 @@ class EtagPropagation extends TestCase {
|
|||
);
|
||||
$this->assertEtagsForFoldersChanged([
|
||||
// direct recipient affected
|
||||
self::TEST_FILES_SHARING_API_USER2,
|
||||
self::TEST_FILES_SHARING_API_USER2,
|
||||
// reshare recipient affected
|
||||
self::TEST_FILES_SHARING_API_USER4,
|
||||
self::TEST_FILES_SHARING_API_USER4,
|
||||
]);
|
||||
|
||||
$this->assertAllUnchaged();
|
||||
|
|
@ -398,4 +398,13 @@ class EtagPropagation extends TestCase {
|
|||
|
||||
$this->assertAllUnchaged();
|
||||
}
|
||||
|
||||
public function testRecipientUploadInDirectReshare() {
|
||||
$this->loginAsUser(self::TEST_FILES_SHARING_API_USER2);
|
||||
Filesystem::file_put_contents('/directReshare/test.txt', 'sad');
|
||||
$this->assertEtagsNotChanged([self::TEST_FILES_SHARING_API_USER3]);
|
||||
$this->assertEtagsChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER4]);
|
||||
|
||||
$this->assertAllUnchaged();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue