OBPIH-7074 bugfix. Prevent stack trace when adding to count items list within loop#5127
Merged
awalkowiak merged 1 commit intodevelopfrom Mar 14, 2025
Merged
OBPIH-7074 bugfix. Prevent stack trace when adding to count items list within loop#5127awalkowiak merged 1 commit intodevelopfrom
awalkowiak merged 1 commit intodevelopfrom
Conversation
ewaterman
commented
Mar 13, 2025
| /** | ||
| * @return the cycle count item matching the given input (which uniquely identifies the item within the count). | ||
| */ | ||
| CycleCountItem getCycleCountItem(Location binLocation, InventoryItem inventoryItem, int countIndex) { |
Member
Author
There was a problem hiding this comment.
from my comment on the other PR https://github.com/openboxes/openboxes/pull/5125/files#r1993935571
Replaces CycleCountService.findItemCreatedFromCustom
| // a product availability record) so make sure to create new recount items for them as well. | ||
| // "Most recent count" in this scenario is the previous count. | ||
| Set<CycleCountItem> customItemsOfLastCount = cycleCount.itemsOfMostRecentCount.findAll{ it.custom } | ||
| for (CycleCountItem customCycleCountItem : customItemsOfLastCount) { |
Member
Author
There was a problem hiding this comment.
This is the real fix. Don't loop the same list that we add to. Everything else is just formatting or variable renames
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5127 +/- ##
============================================
- Coverage 8.15% 8.08% -0.07%
+ Complexity 945 934 -11
============================================
Files 636 636
Lines 43123 43121 -2
Branches 10486 10483 -3
============================================
- Hits 3518 3488 -30
- Misses 39058 39091 +33
+ Partials 547 542 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
kchelstowski
approved these changes
Mar 14, 2025
alannadolny
approved these changes
Mar 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ Description of Change
Link to GitHub issue or Jira ticket: https://pihemr.atlassian.net/browse/OBPIH-7074
Description: Follow up fix to #5125
Submitting a count with a custom item threw an error because we were adding to the customItemsOfLastCount list while looping through it:
I tested the following scenario:
and: