diff --git a/app/Services/Nordigen/Services/AccountInformationCollector.php b/app/Services/Nordigen/Services/AccountInformationCollector.php index 58558b7d..96e7ee4a 100644 --- a/app/Services/Nordigen/Services/AccountInformationCollector.php +++ b/app/Services/Nordigen/Services/AccountInformationCollector.php @@ -99,7 +99,14 @@ class AccountInformationCollector /** @var ArrayResponse $response */ $response = $request->get(); + + if(!array_key_exists('account', $response->data)) { + app('log')->error('Missing account array', $response->data); + throw new ImporterHttpException('No account array, exit.'); + } + $information = $response->data['account']; + app('log')->debug('getAccountDetails: Collected information for account', $information); $account->setResourceId($information['resource_id'] ?? ''); diff --git a/app/Services/Shared/Import/Routine/ApiSubmitter.php b/app/Services/Shared/Import/Routine/ApiSubmitter.php index c3818fdc..2bf80672 100644 --- a/app/Services/Shared/Import/Routine/ApiSubmitter.php +++ b/app/Services/Shared/Import/Routine/ApiSubmitter.php @@ -278,6 +278,16 @@ class ApiSubmitter return $return; } + + // perhaps zero transactions in the array. + if(0 === count($group->transactions)) { + $message = 'Could not create transaction. Transaction-count from Firefly III is zero. Check the logs.'; + app('log')->error($message, $response->getRawData()); + $this->addError($index, $message); + + return $return; + } + $return = [ 'group_id' => $group->id, 'journals' => [], diff --git a/changelog.md b/changelog.md index b0f8d949..cb88bbc5 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## 0.9.3 - 2022-04-05 + +### Fixed + +- A small change should make it easier for the data importer to detect failed transaction creation attempts. +- [Issue 5964](https://github.com/firefly-iii/firefly-iii/issues/5964) Updated libraries to fix issue. + ## 0.9.2 - 2022-04-02 ### Fixed diff --git a/composer.lock b/composer.lock index 7cd3f49d..d76b610e 100644 --- a/composer.lock +++ b/composer.lock @@ -848,12 +848,12 @@ "source": { "type": "git", "url": "https://github.com/JC5/api-support-classes.git", - "reference": "631268f678f5bb0bafd501f5442789a7928908db" + "reference": "d8e5ea055c5738ad906891c5e4a61f5588c20543" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JC5/api-support-classes/zipball/631268f678f5bb0bafd501f5442789a7928908db", - "reference": "631268f678f5bb0bafd501f5442789a7928908db", + "url": "https://api.github.com/repos/JC5/api-support-classes/zipball/d8e5ea055c5738ad906891c5e4a61f5588c20543", + "reference": "d8e5ea055c5738ad906891c5e4a61f5588c20543", "shasum": "" }, "require": { @@ -947,7 +947,7 @@ "type": "patreon" } ], - "time": "2022-03-30T04:35:28+00:00" + "time": "2022-04-03T14:53:54+00:00" }, { "name": "fruitcake/laravel-cors", @@ -8759,16 +8759,16 @@ }, { "name": "sebastian/environment", - "version": "5.1.3", + "version": "5.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", "shasum": "" }, "require": { @@ -8810,7 +8810,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" }, "funding": [ { @@ -8818,7 +8818,7 @@ "type": "github" } ], - "time": "2020-09-28T05:52:38+00:00" + "time": "2022-04-03T09:37:03+00:00" }, { "name": "sebastian/exporter", diff --git a/config/importer.php b/config/importer.php index 5304a0b1..34443af0 100644 --- a/config/importer.php +++ b/config/importer.php @@ -23,7 +23,7 @@ declare(strict_types=1); return [ - 'version' => '0.9.2', + 'version' => '0.9.3', 'flows' => ['nordigen', 'spectre', 'csv'], 'flow_titles' => [ 'csv' => 'CSV', diff --git a/yarn.lock b/yarn.lock index b066fbe3..2204aba9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1865,9 +1865,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001317: - version "1.0.30001324" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001324.tgz#e17c3a8b34822b02d5d15639d570057550074884" - integrity sha512-/eYp1J6zYh1alySQB4uzYFkLmxxI8tk0kxldbNHXp8+v+rdMKdUBNjRLz7T7fz6Iox+1lIdYpc7rq6ZcXfTukg== + version "1.0.30001325" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001325.tgz#2b4ad19b77aa36f61f2eaf72e636d7481d55e606" + integrity sha512-sB1bZHjseSjDtijV1Hb7PB2Zd58Kyx+n/9EotvZ4Qcz2K3d0lWB8dB4nb8wN/TsOGFq3UuAm0zQZNQ4SoR7TrQ== chalk@^2.0.0: version "2.4.2" @@ -4365,9 +4365,9 @@ postcss@^8.1.10, postcss@^8.2.14, postcss@^8.2.15, postcss@^8.4: source-map-js "^1.0.2" "prettier@^1.18.2 || ^2.0.0": - version "2.6.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.1.tgz#d472797e0d7461605c1609808e27b80c0f9cfe17" - integrity sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A== + version "2.6.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" + integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== pretty-time@^1.1.0: version "1.1.0"