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

Inventory not displaying and crash when try to edit #814

Closed
Brew1984 opened this issue Aug 25, 2024 · 7 comments
Closed

Inventory not displaying and crash when try to edit #814

Brew1984 opened this issue Aug 25, 2024 · 7 comments

Comments

@Brew1984
Copy link

Updating from 3.011 to 4.02 the inventory is not migrated. Modifying the inventory in 4.02 results in a crash.

@matty0ung
Copy link
Contributor

Sorry you're hitting problems. Looks like I can recreate the crash locally, so will work on that first. I suspect the inventory migration will be a small fix, but might come back to you for more diagnostic info if need be.

@matty0ung
Copy link
Contributor

I have a fix for the crash. Looking at the other part. Seems the inventory amount is not being displayed, even when it is in the database. Will dig into it further this week.

@matty0ung
Copy link
Contributor

Should be fixed in 4.0.3, but please reopen this issue if not. As ever, if you find other problems, please don't hesitate to open a new issue.

@Brew1984
Copy link
Author

Brew1984 commented Aug 29, 2024 via email

@matty0ung
Copy link
Contributor

Ah, hmm. If you could upload your pre-upgrade DB, I can see if I can work out what the bug in the upgrade process is.

@matty0ung
Copy link
Contributor

Many thanks for emailing me your database file. That enabled me to work out what was going on. When we migrated the inventories, we weren't taking account of deleted items. (Mostly when you delete a hop, fermentable etc, it isn't really deleted in the database, just marked as deleted.) Because of the way we'd done the update, when an inventory amount was shared by a deleted and non-deleted hop/fermentable/etc, it was often getting attached to the deleted on in the new schema. I've changed it so it always prefers to attach the inventory to an undeleted ingredient if one is available. Patch in #823, which I'll merge over the weekend if the builds go OK.

NB: The fix won't apply retrospectively. If you take your current DB away and replace it with the old pre-upgrade one, then the database upgrade will run again with the improved logic, and you should end up with all your inventory amounts in the newly upgraded system. However, any edits you made after the last database upgrade would be lost. So, if you made a lot of edits, you might not want to do this. Instead, we might try to recover your inventory amounts another way. (They are there in your current database, but attached to deleted ingredients.) But it might be a bit involved...

@matty0ung
Copy link
Contributor

Fix included in 4.0.4.

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

No branches or pull requests

2 participants