diff --git a/appinfo/info.xml b/appinfo/info.xml index 2a0ed9c3..3be85423 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -11,7 +11,7 @@ - 1.2.1 + 1.2.2 agpl Robin Appelman NotifyPush diff --git a/lib/Controller/TestController.php b/lib/Controller/TestController.php index d5890522..0c097487 100644 --- a/lib/Controller/TestController.php +++ b/lib/Controller/TestController.php @@ -15,22 +15,26 @@ use OCP\AppFramework\Controller; 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, ) { parent::__construct('notify_push', $request); $this->config = $config; + $this->appConfig = $appConfig; $this->queue = $queue; $this->appManager = $appManager; } @@ -41,6 +45,13 @@ public function __construct( * @NoCSRFRequired */ 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')); }