Topic deletion should clear assignment

An internal user contacted me yesterday because he couldn’t find all the topics assigned to his group. The group count said (at the time) 2, but only one was listed.

Fast-forward to today, when I had time to look at it, and the count says 4 but only 3 are listed:

Fortunately <cracks knuckles/> we have Data Explorer installed. It found all 4 for me:

It turns out that somewhere between my assigning the topic and my colleague looking for it, the 4th was flagged by the user:

and deleted by a 3rd colleague:

IMO the assignment should have been removed as part of the deletion action.

2 Likes

And in fact… I’m just noticing post creation / assignment / flag-and-remove dates are in April. And I don’t think the numbers were off (i.e. including deleted posts) until recently. I wonder if @nat’s recent changes played a part in this.

1 Like

This happened again today, only worse:

Here’s my query:

SELECT a.* 
FROM assignments a
JOIN groups g on g.id=a.assigned_to_id
WHERE a.assigned_to_type='Group'
AND g.name='xxx'

In one of ‘deleted by author’ posts, my attempts to unassign it don’t “take”. I unassign, the action does not show up in the thread, and a page refresh shows it’s still assigned to the group.

Edit: I had to undelete the topic before I could unassign it and get it removed from the group’s total assignment count. (Then re-deleted it.)

1 Like