I have been very dissatisfied with the number of bugs I'm seeing, and especially the database corruption I've been seeing in both bug reports and my own experience.
Therefore, I plan on doing a database overhaul, which in the long term should mean less bugs and data corruption, although new code may mean new bugs in the short term.
Technical details (long read):
I've been noticing a pattern in bug reports. Many of them have been involving the database, and the newest ones often even include database corruption. There's also been quite a few dealing with the safeGetItemInfo function.
The database is the heart and core of Reagent Restocker: It keeps track of all of the items in the various lists, provides information that can be used for the automatic selling features (selling items that aren't relevant to your class, selling grey items, etc), and it also serves as a cache for safeGetItemInfo.
safeGetItemInfo is an old function used before I took over the project. Its purpose was simple: Avoid the client crashes that could happen when a player requests an item that hasn't been seen since the last server reboot. It does this by querying Reagent Restocker's own database and only using Blizzard's GetItemInfo as needed.
Unfortunately, things changed. Cayaclysm changed the way GetItemInfo works. Mists of Pandaria added caged pets.
The database and safeGetItemInfo served Reagent Restocker well, but it's time for a few changes.
* safeGetItemInfo is a function that returns a LOT of values, so that even if you only want one of them, you end up getting all of them.
* Cataclysm changed the way it manages the local cache of items. Not totally sure I understand the changes, however it appears it's still possible to return nil if it can't find the item in the cache. However, Cataclysm and Mists may handle it more safely, preventing the client from crashing, reducing the need for a separate safeGetItemInfo.
* With the new caged pets, a different set of values can be returned, so what it returns depends on what the item is.
* Having too many return values (especially when you usually only need one or two of them) isn't really considered to be good development practice anyways.
This actually was a design decision that Blizzard made: safeGetItemInfo is based on GetItemInfo, which accomplishes the same thing, but may have caused crashes in vanilla WoW.
It's also the case that the error messages when something in the database fails have been baffling: All too often I get something like " attempt to index field '?' (a nil value)" - which is baffling because it's not telling me which field is nil. A database that uses getter and setter methods instead of direct access could potentially give me a lot more information about the exact cause of the error.
The new database design is likely to use getter and setter methods instead of an all-encompassing safeGetItemInfo function, and will be intelligent enough to use GetItemInfo as needed. I haven't settled on the exact design, but it will be the case that the database will eventually be accessed via functions designed to access it, and will not be directly accessed.
By not allowing direct access, I'm hoping that the data corruption issues will be easier to solve, as the database would be responsible for the integrity of its own data. It could check the data as it comes in and out of the database, and raise an error earlier when it has a problem. Mysterious data corruption is not something I really want to deal with in the long term future of Reagent Restocker.
2.5.3 introduced a tagging system, which was a first attempt to do this, but never really completely replaced the entire database. All it really ended up doing was assigning items to lists.
So the database is currently a combination of safeGetItemInfo, a tagging system that never really fulfilled its ultimate purpose, and direct access.
So that's my next big project, after I get to the states. That and continuing work on the new UI.