netcreateorg / netcreate-itest

Developing the 2.0 version of NetCreate
https://github.com/netcreateorg/netcreate-2018
Other
0 stars 0 forks source link

Comments are never truly deleted #165

Closed benloh closed 2 months ago

benloh commented 2 months ago

Currently when you delete a node/edge that has comments, we are not actually deleting the comments. This means, if you delete a node, but then add a node that uses the same collection reference id (e.g. n4 for Node 4, which maybe was previously deleted, but upon restarting the app, you might end up with a Node 4 again because it was previously deleted), any comments that had previously existed will also be restored.

This shouldn't come up too much since you'd have to somehow re-use the node id. Generally this would only happen if you delete a bunch of nodes that have comments, shut down the server, and restart it. The current id count is reset.

benloh commented 2 months ago

@jdanish Is it safe to assume that if a user requests to delete a node or an edge, it's OK to delete it even if there are comments (read or unread) still attached to the node/edge? In other words, the presence of unread comments should not prevent you from being able to delete a node? Or do you want to prevent someone from deleting a node or edge if there are unread comments?

At first I thought we could get away with ignoring the main issue (that a deleted node does not delete the comment), but after testing it out, we could very well end up with mysterious holdover comments.

jdanish commented 2 months ago

I think delete it and the comments go with it. Thanks!

benloh commented 2 months ago

Implemented with 9e1735903e1486afeb14e1b8cfd2d9aa94c723d9