gracefully handle deleteFromSelf when share is already gone

- handling race conditions

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2021-03-30 12:59:40 +02:00 committed by backportbot[bot]
parent 99e2e5f6b9
commit 47abd1f37e
2 changed files with 2 additions and 4 deletions

View File

@ -469,7 +469,8 @@ class DefaultShareProvider implements IShareProvider {
} }
if (!$group->inGroup($user)) { if (!$group->inGroup($user)) {
throw new ProviderException('Recipient not in receiving group'); // nothing left to do
return;
} }
// Try to fetch user specific share // Try to fetch user specific share

View File

@ -1558,9 +1558,6 @@ class DefaultShareProviderTest extends \Test\TestCase {
public function testDeleteFromSelfGroupUserNotInGroup() { public function testDeleteFromSelfGroupUserNotInGroup() {
$this->expectException(\OC\Share20\Exception\ProviderException::class);
$this->expectExceptionMessage('Recipient not in receiving group');
$qb = $this->dbConn->getQueryBuilder(); $qb = $this->dbConn->getQueryBuilder();
$stmt = $qb->insert('share') $stmt = $qb->insert('share')
->values([ ->values([