Well almost got VaultWiki 4 reinstalled today, but encountered a little catastrophe and need to restart now. Shouldn't be too big a deal since we have backups, but definitely good we caught this bug now and not after release.
Essentially the way pages work now is that they can be regular pages, or they can be assigned a node type like
Book or
Category. You can also change the assignment at a later date. Say you had a Book, and you wanted it to be a Category instead. You could change the toggle from the edit view of the page, that would remove the Book row and clear all the chapters.
Now
wiki Areas are the main containers in the wiki (think forums), and each Area has a specific page associated with it. Well it turns out if you're making changes to the page with the Area type - specifically we were running an upgrade that modified pages in general - you need to be especially careful. If the upgrade process (or potentially a third-party mod) entered the wrong type-ID for the Area page, the page would lose its Area-ness, remove the Area from the database, and in turn remove all its child content (think 100s or 1000s of wiki pages) from the database.
So I had to add a little check to the Page DM: if we forget the type-ID for the Area and it was there before, treat it as though we didn't forget it.
Another day, another bug squashed. Will try the upgrade again with this change on the next shift.
-- EDIT --
Sigh. Now that I think about it, there's a much better way to protect changeable types too. Add
add_type and
remove_type functions to the Page DM. This way the type can't be "accidentally" removed - it can only happen if remove_type('type') was called before save(). Created a report so I don't forget about this next time I'm in:
https://www.vaultwiki.org/issues/2626/