]> source.dussan.org Git - nextcloud-server.git/commitdiff
gracefully handle deleteFromSelf when share is already gone 26382/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Tue, 30 Mar 2021 10:59:40 +0000 (12:59 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 30 Mar 2021 20:26:29 +0000 (20:26 +0000)
- handling race conditions

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
lib/private/Share20/DefaultShareProvider.php
tests/lib/Share20/DefaultShareProviderTest.php

index cf05e9bfbc398d566c949a613f6e218ef4a27ce7..00ef7e2426b9b90725552a20875bf340f0369295 100644 (file)
@@ -470,7 +470,8 @@ class DefaultShareProvider implements IShareProvider {
                        }
 
                        if (!$group->inGroup($user)) {
-                               throw new ProviderException('Recipient not in receiving group');
+                               // nothing left to do
+                               return;
                        }
 
                        // Try to fetch user specific share
index f6ce4894dbbc52f473f9983ed216e5ba9a17dda9..40626bdb57134cac1350d7129661acf328ffbb27 100644 (file)
@@ -1558,9 +1558,6 @@ class DefaultShareProviderTest extends \Test\TestCase {
 
 
        public function testDeleteFromSelfGroupUserNotInGroup() {
-               $this->expectException(\OC\Share20\Exception\ProviderException::class);
-               $this->expectExceptionMessage('Recipient not in receiving group');
-
                $qb = $this->dbConn->getQueryBuilder();
                $stmt = $qb->insert('share')
                        ->values([