Comment 8 for bug 1243395

Revision history for this message
Cris Dywan (kalikiana) wrote :

> Having an empty document as a delegate of the ListView should be expected behaviour,
> if the document in the model is empty. However, a deleted document
> and empty document are not the same thing.

That's not in line with current API semantics: Query won't show "empty aka deleted" documents, there's bug 1219862 about making Database not show them. I'm a bit puzzled at the "brainstorming" of existing behavior that people use out there already.

> Regarding comment #2, that sounds a little bit similar to doing this:
> The Item needs to be removed from the model, not simply made null.

This is exactly what convinced me to propose API for this. I don't want to second-guess bugs. "Set to null" might refer to a variable, contents or putDoc. And even your suggestion "removed from the model" is not clear to me as a developer since your incomplete example uses a non-existing "remove" method.

Having Database.removeDoc(docId) would make this clear. Either it works or it doesn't. If we were to add a distinction between empty and deleted documents as you suggested above (which would be a behavior change!) the method could be updated to do it.