Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pickup problem (3557) #3740

Merged
merged 4 commits into from
Jul 14, 2023
Merged

Pickup problem (3557) #3740

merged 4 commits into from
Jul 14, 2023

Conversation

cielf
Copy link
Collaborator

@cielf cielf commented Jul 13, 2023

Partially Resolves #3557

Description

This is a partial fix for an issue is occurring dozens of times a week -- though I think most of those are frurstrated retries.

If there is no inventory item for a particular item when we attempt to complete a distribution, an exception is thrown, and the distribution does not complete (silently)

It turns out that we are deleting the inventory items when there is no current inventory. This has some other side effects (e.g. not seeing the inventory history)

To be discussed

Do we 1/ create new 0-quantity inventory items for the items that would have this problem (find by crawling the scheduled distributions), 2/ try somehow to connect back to existing history, or 3/ just let it ride?

I'm for option 1, I think -- option 2 is practically impossible, and option 3 will take some time to actually resolve.

NB*
This PR only fixes the base issue on a go-forward basis.


There are some side effects of having deleted the inventory items, though.

  • not seeing the inventory history anymore
  • there wouldn't be an entry in the audit (might not be that big a deal)

This solution does mean that if someone corrects a purchase back to 0, the inventory item will not be removed. I think that's fine -- Again, for reasons of keeping the history.

It also means that 0-quantity items will appear in the distribution drop downs. We could filter those out. I'm not sure how big a problem that will be perceived to be.

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • automated system test added. Some tests deleted

from_location.remove_empty_items
to_location.remove_empty_items
# from_location.remove_empty_items
# to_location.remove_empty_items
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove these lines?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pos def. Will do.

@cielf cielf requested a review from dorner July 14, 2023 20:31
@dorner
Copy link
Collaborator

dorner commented Jul 14, 2023

Fingers crossed!

@dorner dorner merged commit 6dee551 into rubyforgood:main Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Investigation] Uncaught exception in distributions_controller.pickedup
2 participants