romshark / dgraph_graphql_go

A GraphQL + Dgraph + Go + HTTP based backend service demo.
MIT License
50 stars 15 forks source link

Reaction & Post Deletion #24

Open DanielSharkov opened 5 years ago

DanielSharkov commented 5 years ago

Add post and reaction deletion capabilities.

romshark commented 5 years ago

I'm planning to implement this functionality in later releases. BTW, Posts and reactions won't actually be deleted, just removed (archived). But I'm not yet sure how it should work.

Let's imagine we removed post a_p from user a to which we had a reaction b_r posted by user b. Should b_r also be removed when a_p is removed? Or should it remain untouched and point to a "this post was removed by the author/moderation" placeholder?

DanielSharkov commented 5 years ago

Well that's a very good question. Should be well overthought. Like the reactions should be deleted as well, because the post ist actually deleted (removed). So they mustn't point on a removed post – It's like a nil pointer, the post doesn't exist anymore.

romshark commented 5 years ago

Actually, It's not so easy. Imagine spending hours writing a reaction just to suddenly realize it's lost due to the author of the superordinate post/reaction removing it. It can be a pain in the a. Or, if there's a way to share a public link to a certain reaction then this link will be broken when the post is dead, which isn't good at all.

This is why I didn't implement this feature yet. Maybe it doesn't even make sense to implement it, it's just a tech-demo after all, yet demonstrating filtering by "archived" flags would still be interesting.

winterale commented 5 years ago

I think this is an interesting problem that really depends on the context of the application's function. For example, Reddit will leave any nested comments (equivalent to a reaction) on deleted posts. This makes sense because the conversation could continue even if the original post is removed. Are you planning on allowing reactions to reactions? If you are doing any sort of message board with a thread of conversation, which it appears you are doing with this application, then I think you should simply have the reaction point to a post marked as removed.

romshark commented 5 years ago

@winterale