Comments that are removed/deleted still return content
If a comment is removed/deleted I think that the api should not return the CommentView.content field. Some third party frontends do not properly hide that content, and I think the intention if a user removes content should be that it is no longer public.
I believe that it is only returned if you are the comment creator, and possibly for admins/mods. Did you test this without login?
We used to have a ton of overly-complicated code for overwriting these fields when the flag was deleted, but we got rid of it cause it was too complicated.
UIs should take note of the deleted / removed flags, and hide that content how they see fit.
If someone does find a way to implement this tho in a way that doesn't add a lot of code complication, I'd be fine with overwriting that.
Ever considered dropping diesel? something like this is trivial in other ORMs i've worked with. Diesel has been probably the most difficult i've ever worked with and its so weak
What do you suggest? And how exactly is it easier than diesel?
I know there are other orms for rust, just from casual browsing of programming forums, they seem to be more liked. Here's how c# efcore does it
Literally trivial. I would have no idea how to accomplish that in diesel cause its so incredibly rigid
That's also a post-select, code-manipulation solution to the problem. The correct solution to this should happen at the postgres / select layer.
Its probable that diesel can do proper postgres conditional case when selects, you'd just have to look into the diesel docs or ask them how to do this.
Nope, all sql
Okay then, I'm not familiar with that library so it looked like the closure was moving the row results into them. Did you look into whether diesel supports case when conditionals?
I'm wondering, wouldn't it be better to actually delete the content instead of just setting the flag?
And I mean in addition to the flag, so still have the row but the content will be empty (also for posts) plus the deleted flag.
Also, seems deletes aren't federated
You can see in here the comment in my instance has been deleted https://lemmy.pe1uca.dev/comment/13578
But it still shows up in other instances https://beehaw.org/comment/107195
Deletes federate, but in a distributed system like Lemmy there is no guarantee that they will be delivered successfully.