Refactor Database Maintenance Helper (prototype) to implement a streamlined Validation API
rdw-software opened this issue · 4 comments
- Required fields need to exist, and be named consistently (Id vs ID vs id, etc.)
- Types should be consistent, as well. Right now they're really not, which has caused multiple bugs
- Some fields may be obsolete or could be done away with? (Personal Loot related, I suppose)
- All items should have zones assigned so the tooltip doesn't just show an empty entry
- Waypoints themselves are optional, but should also use the UiMapIDs as constants, and not have hardcoded values like they do now
- Some zones may be missing subzones, which could be especially problematic for the fishing detection. Is there an automatic way of finding out which? May be able to use HereBeDragons migration API from back when Blizzard switched to UiMapIDs
- The existing code is a mess, as it was merely a quick prototype
- Add a button to the UI where it can be run manually?
- Defeat detection? Not sure if this is easy to validate...
- Output in a scrolling frame, instead of in chat? There are so many items that it can't even be read
- Maybe display a summary, as well? Something like X failed, Y succeeded, Z warnings?
- It should be possible to check custom items to avoid errors like the one caused by adding empty item data as a "custom" item (separate issue)
Related WowAce issue: https://www.wowace.com/projects/rarity/issues/467
I'm thinking what would make more sense is to have a separate Validation
API. This could implement methods to validate entire groups as well as individual entries.
It should also be usable to validate custom entries and immediately bonk users on the head if they enter something that makes no sense... I don't think much in the way of validation exists for custom items, so often what someone enters just won't work and they'll report it as a bug instead.
The basic idea of the original prototype was indeed not bad, but it would benefit from some streamlining. Something like the JOI API (but without the ugly JavaScript semantics) perhaps?
In this spirit, I'll refocus this issue to actually refactor the DB maintenance helper and implement the Validation
API.
Also, I know the prototype shouldn't have been merged into master in the current state, but it's too late now so we'll just have to deal with it 🤪