-
Notifications
You must be signed in to change notification settings - Fork 241
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
Shortcuts can cause db exceptions with foreign keys #782
Comments
To Reproduce at baff0fa
Exception 1 Exception 2 |
Bug Report or Feature Request (mark with an
x
)2018-05-09 05:57:07,618 ERROR: SaveBiota failed with exception: Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> MySql.Data.MySqlClient.MySqlException: Cannot add or update a child row: a foreign key constraint fails (ace_shard.biota_properties_shortcut_bar, CONSTRAINT wcid_shortcut_objectId FOREIGN KEY (shortcut_Object_Id) REFERENCES biota (id) ON DELETE CASCADE ON UPDATE NO ACTION) ---> MySql.Data.MySqlClient.MySqlException: Cannot add or update a child row: a foreign key constraint fails (ace_shard.biota_properties_shortcut_bar, CONSTRAINT wcid_shortcut_objectId FOREIGN KEY (shortcut_Object_Id) REFERENCES biota (id) ON DELETE CASCADE ON UPDATE NO ACTION)
I think for the shortcut bar, it will make sense to remove the key constraint.
It's not critical if an item is deleted but it's shortcut is not. if it's not critical, the key constraint is not required.
Will have to test the scenario where a user adds a short cut, deletes the item, and relogs. Does the client still get sent the old item id? What does the client show? What happens to the shortcut list when a user drops a new item onto the bar?
I have a theory that we won't even have to manage removal of shortcut items when an item is removed from inventory (or destroyed). I think the client handles this all safely.
If that is the case (which I hope), we wouldn't have to check if an item exists as a shortcut at the time of inventory removal, which keeps this whole process very clean.
The text was updated successfully, but these errors were encountered: