From 06a76803d02c6af1e7e03d7c911b1616b22d26d2 Mon Sep 17 00:00:00 2001 From: Alexander Piskun <13381981+bigcat88@users.noreply.github.com> Date: Fri, 29 Mar 2024 12:29:14 +0300 Subject: [PATCH 1/2] corrected error handling for occ:app:register and "update" Signed-off-by: Alexander Piskun --- CHANGELOG.md | 6 ++++++ lib/Service/ExAppService.php | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d48ab024..d571c04e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [2.3.3 - 2024-04-xx] + +### Fixed + +- Corrected error handling for `occ` commands: `register` and `update`. #257 + ## [2.3.2 - 2024-03-28] ### Added diff --git a/lib/Service/ExAppService.php b/lib/Service/ExAppService.php index 2d47bea5..9371a17d 100644 --- a/lib/Service/ExAppService.php +++ b/lib/Service/ExAppService.php @@ -220,6 +220,9 @@ public function getLatestExAppInfoFromAppstore(string $appId, string &$extracted $exAppAppstoreData = array_filter($exApps, function (array $exAppItem) use ($appId) { return $exAppItem['id'] === $appId && count($exAppItem['releases']) > 0; }); + if (empty($exAppAppstoreData)) { + return null; + } $exAppAppstoreData = end($exAppAppstoreData); $exAppReleaseInfo = end($exAppAppstoreData['releases']); if ($exAppReleaseInfo !== false) { @@ -263,6 +266,9 @@ public function getAppInfo(string $appId, ?string $infoXml, ?string $jsonInfo): } } else { $xmlAppInfo = $this->getLatestExAppInfoFromAppstore($appId, $extractedDir); + if (empty($xmlAppInfo)) { + return ['error' => sprintf('Failed to get app info for `%s` from the Appstore', $appId)]; + } } $appInfo = json_decode(json_encode((array)$xmlAppInfo), true); if (isset($appInfo['external-app']['scopes']['value'])) { From 8ecb316132538738c0ed1849fa0a9ee2bdc34f83 Mon Sep 17 00:00:00 2001 From: Alexander Piskun <13381981+bigcat88@users.noreply.github.com> Date: Fri, 29 Mar 2024 12:34:58 +0300 Subject: [PATCH 2/2] increased supported NC server version to 30 Signed-off-by: Alexander Piskun --- CHANGELOG.md | 2 +- appinfo/info.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d571c04e..095dbd1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed -- Corrected error handling for `occ` commands: `register` and `update`. #257 +- Corrected error handling for `occ` commands: `register` and `update`. #258 ## [2.3.2 - 2024-03-28] diff --git a/appinfo/info.xml b/appinfo/info.xml index d2a90403..b3850203 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -62,7 +62,7 @@ to join us in shaping a more versatile, stable, and secure app landscape. https://raw.githubusercontent.com/cloud-py-api/app_api/main/screenshots/app_api_4.png - + OCA\AppAPI\BackgroundJob\ExAppInitStatusCheckJob