Skip to content

Handle missing product data in stock flows - #1007

Open
exquisiteskink wants to merge 2 commits into
patzly:masterfrom
exquisiteskink:fix/missing-product-data
Open

exquisiteskink wants to merge 2 commits into
patzly:masterfrom
exquisiteskink:fix/missing-product-data

Conversation

@exquisiteskink

Copy link
Copy Markdown

Stock flows can crash or permit invalid transactions when a product name, location, or quantity unit is missing. Handle missing names during sorting and searching, display Unknown for missing locations, and omit an absent location from consume requests so Grocy selects its default. Guard the product overview's unit-dependent prices and stock actions. Consume, purchase, and inventory submissions require a valid stock quantity unit and explain how to repair the product when it is missing.

Fixes #959.
Fixes #833.
Fixes #982.

Validation:

  • 8 Robolectric regression tests covering missing locations, missing names, early searches, sorting, and quantity-unit validation across all three transaction forms.
  • Fold6 / Android 16 against an isolated Grocy 4.7.1 server: consuming with missing location data succeeded and omitted location_id from the request; the product overview opened with missing unit data and the transaction displayed a repair message instead of submitting; stock sorting and searching succeeded with a nameless product.
  • :app:testDebugUnitTest :app:assembleDebug :app:lintDebug completed successfully; no additional lint findings compared with upstream master.
  • All four related fixes merge without conflicts and pass 32 tests together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant