The Case of Partial Comments
Posted by Doug
For anyone interested, here is a highly technical peak into what we have built. We have a central concept of items. Not everything is an item, but most things are -- maps, features, users, communities, comments, notes, even locations (although they aren't stored in the database, but generated on the fly by a geocoder). This allows us to have a common set of data for everything. One example is "articles," which we use for map descriptions, user profiles and comment bodies. Other examples are permissions, ratings and geometries.
It's a handy system, and works fairly well -- we just use the hooks we need, when we need them. But, occasionally, it has gotchas. For instance, when deleting comments we forgot to delete their items. That can cause problems - say a search returns some of these partial comments - the unsurprising result is an error.
This is partly a symptom of something else -- items were a late addition. Originally, maps, features, users and communities were their own thing, as well as comments. When we changed over to items, the code for displaying them also changed. That change happened long ago, but ever so often we run into an unanticipated side effect like this one.
But now they're fixed again, and we've got tests in place to make sure they stay fixed.

