diff --git a/lib/Command/CirclesCheck.php b/lib/Command/CirclesCheck.php index 27581c568..f41d6bc60 100644 --- a/lib/Command/CirclesCheck.php +++ b/lib/Command/CirclesCheck.php @@ -254,11 +254,12 @@ private function setupLoopback(InputInterface $input, OutputInterface $output, s * @throws UnknownRemoteException */ private function testLoopback(InputInterface $input, OutputInterface $output): bool { + $this->appConfig->setValueInt(Application::APP_ID, 'test_dummy_token', time() + 10); + if (!$this->testRequest($output, 'GET', 'core.CSRFToken.index')) { return false; } - $this->appConfig->setValueInt(Application::APP_ID, 'test_dummy_token', time() + 10); if (!$this->testRequest( $output, 'POST', 'circles.EventWrapper.asyncBroadcast', ['token' => 'test-dummy-token'] diff --git a/lib/Service/FederatedEventService.php b/lib/Service/FederatedEventService.php index 25e0e6088..a63998445 100644 --- a/lib/Service/FederatedEventService.php +++ b/lib/Service/FederatedEventService.php @@ -386,7 +386,9 @@ private function configureEvent(FederatedEvent $event, IFederatedItem $item) { public function initBroadcast(FederatedEvent $event): bool { $instances = $this->getInstances($event); // if empty instance and ran from CLI, any action as already been managed - if (empty($instances) && (!$event->isAsync() || OC::$CLI)) { + // except for loopback tests which need async verification even from CLI + $isLoopbackTest = is_a($event->getClass(), IFederatedItemLoopbackTest::class, true); + if (empty($instances) && (!$event->isAsync() || (OC::$CLI && !$isLoopbackTest))) { return false; }