diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2017-02-20 09:45:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-20 09:45:12 +0100 |
commit | 6914fdd8d8f7045f9334ddb70a3fa4c794291eb3 (patch) | |
tree | bebdebcff2d3d4ae0c82bafd04194f091d09db76 | |
parent | 48be826ea981188c882694ca3e488d0fcaac79d3 (diff) | |
parent | b45b6b6707de9e4518d99c58b0a0bf7d886971b7 (diff) | |
download | wallabag-6914fdd8d8f7045f9334ddb70a3fa4c794291eb3.tar.gz wallabag-6914fdd8d8f7045f9334ddb70a3fa4c794291eb3.tar.zst wallabag-6914fdd8d8f7045f9334ddb70a3fa4c794291eb3.zip |
Merge pull request #2915 from wallabag/import-drop-msg-user-null
Import: we now skip messages when user is null
3 files changed, 6 insertions, 3 deletions
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 | |||
46 | if (null === $user) { | 46 | if (null === $user) { |
47 | $this->logger->warning('Unable to retrieve user', ['entry' => $storedEntry]); | 47 | $this->logger->warning('Unable to retrieve user', ['entry' => $storedEntry]); |
48 | 48 | ||
49 | return false; | 49 | // return true to skip message |
50 | return true; | ||
50 | } | 51 | } |
51 | 52 | ||
52 | $this->import->setUser($user); | 53 | $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; | |||
183 | 183 | ||
184 | $message = new AMQPMessage($body); | 184 | $message = new AMQPMessage($body); |
185 | 185 | ||
186 | $consumer->execute($message); | 186 | $res = $consumer->execute($message); |
187 | |||
188 | $this->assertTrue($res); | ||
187 | } | 189 | } |
188 | 190 | ||
189 | public function testMessageWithEntryProcessed() | 191 | 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; | |||
182 | 182 | ||
183 | $res = $consumer->manage($body); | 183 | $res = $consumer->manage($body); |
184 | 184 | ||
185 | $this->assertFalse($res); | 185 | $this->assertTrue($res); |
186 | } | 186 | } |
187 | 187 | ||
188 | public function testMessageWithEntryProcessed() | 188 | public function testMessageWithEntryProcessed() |