Open SychO9 opened 3 years ago
flarum/framework#2902 is related. Issue is that we check for CommentPost relationship and don't fall back to retrieving by user ID from DB.
Not quite, we shouldn't fallback, we currently retrieve using the relationship because it's efficient, we can eager load the related mentions (which we do) then grab from the collection, but if we fallback, it'll result in multiple queries to the database, and it would also be inconsistent.
Whatever our solution is, that's the current situation - don't necessarily need fallback for fix.
It seems like the post mentions relationships are deleted when the post is deleted, we should refrain from doing so and instead delete those relationships when the post is actually hard deleted (forever).
This proposal makes sense to me
Actually, we do want to hide these on soft delete, because otherwise hidden posts will show up in the "mentionedBy" section of the footer.
Wouldn’t it make sense to have a isHidden column on the relationship (if that makes sense) which we set to true if the post is soft deleted?
Wouldn’t it make sense to have a isHidden column on the relationship (if that makes sense) which we set to true if the post is soft deleted?
That would probably be best. We might also want to do https://github.com/flarum/mentions/pull/42 before this.
Bug Report
Current Behavior When you delete a post that contains mentions to posts or users, those mentions for some reason show as deleted/unknown.
Steps to Reproduce
Expected Behavior There is no reason for the mentions not to be valid, they should be rendering correctly.
Environment
Possible Solution It seems like the post mentions relationships are deleted when the post is deleted, we should refrain from doing so and instead delete those relationships when the post is actually hard deleted (forever).