Skip to content

Commit ef1ff69

Browse files
authored
Merge pull request #2387 from nextcloud/i2h3/fix/9690491-circles-loopback
fix(loopback): circles:check always fails due to APCu race and missing CLI wrapper
2 parents 3363e5d + 45084d1 commit ef1ff69

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/Command/CirclesCheck.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,12 @@ private function setupLoopback(InputInterface $input, OutputInterface $output, s
256256
* @throws UnknownRemoteException
257257
*/
258258
private function testLoopback(InputInterface $input, OutputInterface $output): bool {
259+
$this->appConfig->setValueInt(Application::APP_ID, 'test_dummy_token', time() + 10);
260+
259261
if (!$this->testRequest($output, 'GET', 'core.CSRFToken.index')) {
260262
return false;
261263
}
262264

263-
$this->appConfig->setValueInt(Application::APP_ID, 'test_dummy_token', time() + 10);
264265
if (!$this->testRequest(
265266
$output, 'POST', 'circles.EventWrapper.asyncBroadcast',
266267
['token' => 'test-dummy-token']

lib/Service/FederatedEventService.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,9 @@ private function configureEvent(FederatedEvent $event, IFederatedItem $item) {
344344
public function initBroadcast(FederatedEvent $event): bool {
345345
$instances = $this->getInstances($event);
346346
// if empty instance and ran from CLI, any action as already been managed
347-
if (empty($instances) && (!$event->isAsync() || OC::$CLI)) {
347+
// except for loopback tests which need async verification even from CLI
348+
$isLoopbackTest = is_a($event->getClass(), IFederatedItemLoopbackTest::class, true);
349+
if (empty($instances) && (!$event->isAsync() || (OC::$CLI && !$isLoopbackTest))) {
348350
return false;
349351
}
350352

0 commit comments

Comments
 (0)