From: Nicolas LÅ“uillet Date: Mon, 20 Feb 2017 08:45:12 +0000 (+0100) Subject: Merge pull request #2915 from wallabag/import-drop-msg-user-null X-Git-Tag: 2.2.2~8 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=6914fdd8d8f7045f9334ddb70a3fa4c794291eb3;hp=48be826ea981188c882694ca3e488d0fcaac79d3;p=github%2Fwallabag%2Fwallabag.git Merge pull request #2915 from wallabag/import-drop-msg-user-null Import: we now skip messages when user is null --- diff --git a/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php b/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php index fc175f67..992ce1ad 100644 --- a/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php +++ b/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php @@ -46,7 +46,8 @@ abstract class AbstractConsumer if (null === $user) { $this->logger->warning('Unable to retrieve user', ['entry' => $storedEntry]); - return false; + // return true to skip message + return true; } $this->import->setUser($user); diff --git a/tests/Wallabag/ImportBundle/Consumer/AMQPEntryConsumerTest.php b/tests/Wallabag/ImportBundle/Consumer/AMQPEntryConsumerTest.php index 856954a6..a989ec7f 100644 --- a/tests/Wallabag/ImportBundle/Consumer/AMQPEntryConsumerTest.php +++ b/tests/Wallabag/ImportBundle/Consumer/AMQPEntryConsumerTest.php @@ -183,7 +183,9 @@ JSON; $message = new AMQPMessage($body); - $consumer->execute($message); + $res = $consumer->execute($message); + + $this->assertTrue($res); } public function testMessageWithEntryProcessed() diff --git a/tests/Wallabag/ImportBundle/Consumer/RedisEntryConsumerTest.php b/tests/Wallabag/ImportBundle/Consumer/RedisEntryConsumerTest.php index 3b92f759..78bd83ba 100644 --- a/tests/Wallabag/ImportBundle/Consumer/RedisEntryConsumerTest.php +++ b/tests/Wallabag/ImportBundle/Consumer/RedisEntryConsumerTest.php @@ -182,7 +182,7 @@ JSON; $res = $consumer->manage($body); - $this->assertFalse($res); + $this->assertTrue($res); } public function testMessageWithEntryProcessed()