Future fix attachments are not deleted

Adam Howard

Well-known member
So I copied over my whole site so I can use it as a proper test site with all the add-ons and such installed. Well obviously, that meant deleting all the users and all the threads and post.

Just for good measure after deleting everything and everyone, I decided to rebuild all the cache. Good opportunity to empty out the search index and other tables that may still record some old things.

Upon telling it to rebuild image thumbnails, which there should be none since I just deleted everything... I see this. Even though there is zero post, there zero threads, and I am now the only user.

Screenshot from 2013-11-21 18:12:09.webp
 
The attachment data is deleted in the Hourly Clean Up cron entry. That's why they are still there when you rebuild the thumbnail. Force it to delete immediately by running the cron entry in AdminCP.
 
The attachment data is deleted in the Hourly Clean Up cron entry. That's why they are still there when you rebuild the thumbnail. Force it to delete immediately by running the cron entry in AdminCP.
Nope.

I ran every cron manually, including Hourly Clean Up and Daily Clean Up.

Looking at the data base the attachments are associated with

xf_attachment > conversation_message

Even though I left every PM (using the ignore option) and so my inbox looks like this (see attached) and there are no other users (I deleted them all, so I am the only member left)
 

Attachments

  • Screenshot from 2013-11-21 22:15:35.webp
    Screenshot from 2013-11-21 22:15:35.webp
    29.9 KB · Views: 67
Last edited:
Nope.

I ran every cron manually, including Hourly Clean Up and Daily Clean Up.

Looking at the data base the attachments are associated with

xf_attachment > conversation_message

Even though I left every PM (using the ignore option) and so my inbox looks like this (see attached) and there are no other users (I deleted them all, so I am the only member left)
Well, if you do that, the conversation master data is still in the database. It is only deleted when you leave but you left before deleting other users so those conversations are not deleted.
 
Nope.

I ran every cron manually, including Hourly Clean Up and Daily Clean Up.

Looking at the data base the attachments are associated with

xf_attachment > conversation_message

Even though I left every PM (using the ignore option) and so my inbox looks like this (see attached) and there are no other users (I deleted them all, so I am the only member left)
Well, if you do that, the conversation master data is still in the database. It is only deleted when you leave but you left before deleting other users so those conversations are not deleted.
 
Well, if you do that, the conversation master data is still in the database. It is only deleted when you leave but you left before deleting other users so those conversations are not deleted.
That still would be a bug since that is exactly how a live forum would operate

... ie...

People leave conversation (pm's) and people get deleted (for whatever reason). That is why those 2 features are built into XenForo by default (the option to leave a PM and the option to delete a user).

At some point those attachments should be removed and they're not.
 
I think we're in danger of losing sight of the original bug report here.

The original bug report states that despite all threads and posts being deleted, the attachments have still remained. Is this still the case? Or are the attachments you're seeing purely from conversations?
 
I think we're in danger of losing sight of the original bug report here.

The original bug report states that despite all threads and posts being deleted, the attachments have still remained. Is this still the case? Or are the attachments you're seeing purely from conversations?
The bug was the attachments for whatever reason are not deleted and never do delete. Period.

The original assumption was that it was attachments in threads, but it turns out to be attachments in conversation. Even when I deleted all member, left all conversations, ran all cron job clean ups, there were still attachments.

1 GB of attachments (several thousand), that will not delete, is not something you can or should exactly ignore. This is bug.
 
There is possibly a bug, yes. Or at least some wider reason for it. But it is accurate that deleting a user will not attempt to delete the master conversation therefore will not delete the associated attachment data therefore leaving orphaned data and files on the server.

As for leaving a conversation, that is handled properly. If the last person activate in a conversation leaves it, the master is removed which in turn deletes the attachment, data and files (the latter after Crons have run).
 
There is possibly a bug, yes. Or at least some wider reason for it. But it is accurate that deleting a user will not attempt to delete the master conversation therefore will not delete the associated attachment data therefore leaving orphaned data and files on the server.

As for leaving a conversation, that is handled properly. If the last person activate in a conversation leaves it, the master is removed which in turn deletes the attachment, data and files (the latter after Crons have run).
So 2 things that may not be happening (will need looking into)

1)
If both users are deleted, the attachment in the conversation (PM) should be deleted. Because there is no one left to leave the conversation (pm).

(For that matter, so should the PM because there is no one there.)

2)
If one of the users is deleted, then later the remaining user leaves the conversation (PM), the attachment should be deleted. Because there is no one left to leave the conversation (PM).

(For that matter, so should the PM because there is no one to restart the conversation.)
 
Last edited:
3)

If both users leave the conversation (PM), the attachment in the conversation should be deleted. Because there is no one left to leave the conversation (pm)
 
Last edited:
Those are all the same thing.

Which is that once the last registered participant has left the conversation (by virtue of being deleted), the conversation and attachments should be removed.
 
Those are all the same thing.

Which is that once the last registered participant has left the conversation (by virtue of being deleted), the conversation and attachments should be removed.
I know.

I like to be clear though and look at it from all sides. :)
 
This is likely going to be a major pain/issue to fix, as it doesn't apply across the board. It only applies to attachments in conversations where the deleted user is the only person left.

Flipping this around, it's also possible for it to come up when uninstalling an add-on if the add-on allows attachments.
 
Top Bottom