fix: apply post-merge review follow-up#104
Conversation
- enforce non-negative org inventory quantity filters in controller parsing - add regression coverage for negative minQuantity and maxQuantity inputs - stabilize fallback inline drafts so memoized inventory rows do not rerender unnecessarily
There was a problem hiding this comment.
Pull request overview
Follow-up fixes to org inventory filtering validation and frontend inventory row rendering stability.
Changes:
- Enforce
minQuantity/maxQuantityquery filters to be non-negative in the org-inventory controller. - Add regression tests asserting negative quantity filters return
400 BadRequest. - Stabilize inline draft fallback objects in the Inventory page to reduce unnecessary row re-renders.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| frontend/src/pages/Inventory.tsx | Adds memoized fallback draft caching for inline edit rows and cleans up stale cache entries when items change. |
| backend/src/modules/org-inventory/org-inventory.controller.ts | Applies min: 0 validation to min_quantity and max_quantity query parsing. |
| backend/src/modules/org-inventory/org-inventory.controller.spec.ts | Adds tests ensuring negative quantity filters throw the expected BadRequestException. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds inline comment explaining why writing to inlineDraftFallbacks.current during render is safe: the value is derived deterministically from item data so concurrent/aborted renders are idempotent, and stale entries are pruned by the existing [items] effect.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Resolves use-before-define ordering: useRef was declared after the useEffect that references it.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
enforce non-negative org inventory quantity filters in controller parsing
add regression coverage for negative minQuantity and maxQuantity inputs
stabilize fallback inline drafts so memoized inventory rows do not rerender unnecessarily