News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

[Bug] Failed attachment upload not cleaned up properly in all cases

Started by hypno, February 12, 2006, 01:16:57 AM

Previous topic - Next topic

hypno

FYI,
While testing out SMF I tried uploading a 200MB file across my local LAN. The upload failed when my NIC reported that the cable had been disconnected. (This disconnect is an unrelated issue I've been having.)
When I subsequently went and posted a new topic with a few small attachments, all of the small attachments showed up along with a truncated version of the 200MB file.

I attempted to reproduce this by unplugging my network cable in the middle of an upload but was unsuccessful. Here's how I tried to reproduce it.

1) Create a new topic. Add a largish attachment to the post and then submit it.
2) While the post is uploading, unplug the network cable from your machine.
3) Wait until your brower reports the error and then replace the cable to its proper spot.
4) Immediately go to the same forum and create a new topic. Add some small attachments to this topic before posting it.
5) Now go view the newly created topic. The aborted attachment will show up in the new post.

I have a feeling the the attachment is added to the database with a specific post or topic id. Then, when the post fails, that id is removed from the database. Then, the very next post will get the same topic or post id and the attachment will show up in that post.

This implies that if you have a very busy board, it may be difficult to reproduce the error because somebody else may get a post in before you complete step 4 above. I am the only one with access to my board so this is not the cause of my inability to reproduce the bug.

Advertisement: