Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<description><![CDATA[Push update support for desktop app.

Once the app is installed, the push binary needs to be setup. You can either use the setup wizard with `occ notify_push:setup` or see the [README](http://github.com/nextcloud/notify_push) for detailed setup instructions]]></description>
<version>1.2.2</version>
<version>1.3.0</version>
<licence>agpl</licence>
<author>Robin Appelman</author>
<namespace>NotifyPush</namespace>
Expand All @@ -27,7 +27,7 @@ Once the app is installed, the push binary needs to be setup. You can either use
<bugs>https://github.com/nextcloud/notify_push/issues</bugs>

<dependencies>
<nextcloud min-version="27" max-version="32"/>
<nextcloud min-version="29" max-version="33"/>
</dependencies>

<repair-steps>
Expand Down
25 changes: 5 additions & 20 deletions lib/Controller/TestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,16 @@
use OCP\AppFramework\Http\DataDisplayResponse;
use OCP\AppFramework\Http\DataResponse;
use OCP\IAppConfig;
use OCP\IConfig;
use OCP\IRequest;

class TestController extends Controller {
private $config;
private $appConfig;
private $queue;
private $appManager;

public function __construct(
IRequest $request,
IConfig $config,
IAppConfig $appConfig,
IQueue $queue,
IAppManager $appManager,
private IAppConfig $appConfig,
private IQueue $queue,
private IAppManager $appManager,
) {
parent::__construct('notify_push', $request);
$this->config = $config;
$this->appConfig = $appConfig;
$this->queue = $queue;
$this->appManager = $appManager;
}

/**
Expand All @@ -47,12 +36,8 @@ public function __construct(
public function cookie(): DataResponse {
// starting with 32, the app config does some internal caching
// that interferes with the quick set+get from this test.
// unfortunately the api to clear the cache is 29+ only, and we still support 27
if (method_exists($this->appConfig, 'clearCache')) {
/** @psalm-suppress UndefinedInterfaceMethod */
$this->appConfig->clearCache();
}
return new DataResponse((int)$this->config->getAppValue('notify_push', 'cookie', '0'));
$this->appConfig->clearCache();
return new DataResponse($this->appConfig->getValueInt('notify_push', 'cookie'));
}

/**
Expand Down
4 changes: 3 additions & 1 deletion lib/SelfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use OCA\NotifyPush\Queue\RedisQueue;
use OCP\App\IAppManager;
use OCP\Http\Client\IClientService;
use OCP\IAppConfig;
use OCP\IConfig;
use OCP\IDBConnection;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -28,6 +29,7 @@ class SelfTest {
public function __construct(
IClientService $clientService,
private IConfig $config,
private IAppConfig $appConfig,
private IQueue $queue,
private IDBConnection $connection,
private IAppManager $appManager,
Expand Down Expand Up @@ -55,7 +57,7 @@ public function test(string $server, OutputInterface $output, bool $ignoreProxyE
}

$this->queue->push('notify_test_cookie', $this->cookie);
$this->config->setAppValue('notify_push', 'cookie', (string)$this->cookie);
$this->appConfig->setValueInt('notify_push', 'cookie', $this->cookie);

try {
$retrievedCookie = (int)$this->client->get($server . '/test/cookie', ['nextcloud' => ['allow_local_address' => true], 'verify' => false])->getBody();
Expand Down
Loading