Author Topic: Inventory bug ?  (Read 872 times)

Offline Manuj

  • BeerSmith Apprentice Brewer
  • **
  • Posts: 4
  • BeerSmith 3 Rocks!
Inventory bug ?
« on: May 06, 2021, 11:38:39 AM »
Ok, here is the potential problem and how to re-create it :

Have 2 different hops with same name but different AA :
=> Name : Citra, AA : [10%] and inventory zero grams
=> Name : Citra, AA : [13%] and inventory 1000 grams

Design a new recipe with the second citra at 13% requesting 200 grams
This recipe design view will show you that you need 200g, and inventory is 1000 grams. This is right.
BUT
Add the recipe to cart, and look at the shopping list :
=> the shopping list is adding Citra 13% for 200g (needed column), and tells inventory is currently zero grams.

Just delete the other hop with same name, and the problem is gone (shopping list is NOT requesting those 200g, and inventory is rightfully listed as 1000g)

So whenever you have the same name for a hop, things get mixed up.

Offline BOB357

  • BeerSmith Grandmaster Brewer
  • *****
  • Posts: 686
  • Beer is my bucket list!
Re: Inventory bug ?
« Reply #1 on: May 06, 2021, 01:34:12 PM »
The names need to be different for the program to distinguish between them. Just include the AA% in the name and it should work just fine.
Bob

Offline Manuj

  • BeerSmith Apprentice Brewer
  • **
  • Posts: 4
  • BeerSmith 3 Rocks!
Re: Inventory bug ?
« Reply #2 on: May 07, 2021, 12:58:48 AM »
not to be nitpicking, but being myself a software engineer, I think this should be corrected.
Since the software does not behave as intended, this is definition of a software bug. There must have been so many wrong shopping lists because of that.

Whether there is a true database underneath, or just links between class objects being serialized to disk, there should at least be a check not letting users create several items with the same name (if BS requires that to behave correctly).
And what makes it a real bug is that within the recipe, the link is always correct (correct hop/correct inventory link), and when passed to Cart, link is to first hop with same name.

The names need to be different for the program to distinguish between them. Just include the AA% in the name and it should work just fine.
Not true, in recipe the program can distinguish between them. This was misleading for me : recipe was Ok (I had enough hops), but shopping list was then telling me I had none in inventory.

But it would make much more sense to link to the right hop when throwing to Cart (as in recipe) instead of using first hop with a given name.

By the way Water adjuncts also rely on names.... I once changed a given water adjunct name (to fit to my supplier name), and then it was no longer used for BS calculations. Again BS should thus not let user change these names if internally they are so important.