If I delete an object that is referenced from a field on another object, the reference is still preserved. This means I get a reference to a non-existing object. Example:
I have a data type called Organization. It has a field called Members which is a list of Users.
Organization A has one member. I now delete this user. If I search for Organizations where “Members is empty”, Organization A does not show up, because it still has a reference to the user. If I query using the GET API, I also still get the id of the user.
Is this a bug? It’s very inconvenient if you have to manually detect all references to make sure you clean up when you delete something. I cannot really see the use case where you want to preserve the reference to a deleted object…
[EDIT 27. January 2017 - this has now been fixed. Great ]
It’s a (bad) design decision. On our list to clean up, though it involves enough changes to how the delete functionality works that it may be a while before we get around to it.
Great that you are aware of this. It really requires a lot of discipline to make sure to clean up correctly (in addition to a lot of extra expensive “Search for” actions to remove an item from a list before it’s deleted).