1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Future Fix attachments are not deleted

Discussion in 'Future-Fix Bug Reports' started by Adam Howard, Nov 21, 2013.

  1. Adam Howard

    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.png
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Did you wait for the cron to run to remove the attachments after deleting the posts?
     
  3. Mike

    Mike XenForo Developer Staff Member

    Also, how did you delete everything?
     
  4. Adam Howard

    Adam Howard Well-Known Member

    Used the internal mass thread update

    admin.php?threads/batch-update

    Had it find everything, then told it to delete everything. From there I rebuilt all the cache (done it more than once now).
     
  5. xfrocks

    xfrocks Well-Known Member

    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.
     
    SneakyDave likes this.
  6. Adam Howard

    Adam Howard Well-Known Member

    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)
     

    Attached Files:

    Last edited: Nov 22, 2013
  7. xfrocks

    xfrocks Well-Known Member

    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.
     
    SneakyDave likes this.
  8. xfrocks

    xfrocks Well-Known Member

    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.
     
  9. Adam Howard

    Adam Howard Well-Known Member

    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.
     
  10. Chris D

    Chris D XenForo Developer Staff Member

    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?
     
    SneakyDave likes this.
  11. xfrocks

    xfrocks Well-Known Member

    @Adam Howard, I'm pretty sure the conversation master data and its messages are not deleted in your case. That's why attachments are not deleted.
     
    SneakyDave likes this.
  12. Adam Howard

    Adam Howard Well-Known Member

    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.
     
  13. Adam Howard

    Adam Howard Well-Known Member

    That would be a bug.
     
  14. Chris D

    Chris D XenForo Developer Staff Member

    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).
     
  15. Adam Howard

    Adam Howard Well-Known Member

    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: Nov 22, 2013
  16. Adam Howard

    Adam Howard Well-Known Member

    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: Nov 22, 2013
  17. Brogan

    Brogan XenForo Moderator Staff Member

    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.
     
    SneakyDave likes this.
  18. Adam Howard

    Adam Howard Well-Known Member

    I know.

    I like to be clear though and look at it from all sides. :)
     
  19. Chris D

    Chris D XenForo Developer Staff Member

    That already happens as long as that has happened as a result of all users leaving the conversation.
     
    Adam Howard likes this.
  20. Mike

    Mike XenForo Developer Staff Member

    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.
     
    Adam Howard likes this.

Share This Page