supergeorg / Grocy-SwiftUI

A client for Grocy for macOS and iOS, written with SwiftUI
GNU General Public License v3.0
177 stars 17 forks source link

Consume fails in iOS/MacOS App: Fail Message but correct calculations #191

Closed SvenJachalke closed 8 months ago

SvenJachalke commented 9 months ago

Hi to all,

I created a new issue, although its very similar to #185: Each time I consume a product (independent of quick-consume or regular consume) I got the red pop-up error "consume failed". But the number of products decreased by the previously consumed amount ... that's working as expected, but the message is misleading.

The AppLog provides the following:

09.12.2023, 20:07:42: Consume failed: decodingError(error: Grocy_Mobile.APIError.errorString(description: "Shopping list does not exist"))

For me a missing shopping list is not related to consumption?

About my Grocy Installation:

I hope you can help me. Thanks in advance!

Originally posted by @SvenJachalke in https://github.com/supergeorg/Grocy-SwiftUI/issues/185#issuecomment-1848622336

supergeorg commented 8 months ago

Well, this error seems to be thrown by the Grocy Server itself (somewhere in /services/StockService.php)

I think the main culprit for this is a missing/wrong setting in the App. The function "AddMissingProductsToShoppingList" can trigger this error, and is the most likely candidate for that. Please check if Settings -> Shopping list settings -> Automatically add ... is enabled and a shopping list is selected.

SvenJachalke commented 8 months ago

Awesome! You were absolutely right ... I guess, I deleted all shopping lists, which then cased this error. But really unintuitive. But thanks a lot for the solution!