Fixed member able to bypass attachment limit (when dragging files into the editor)

Good catch, yeah seems to be a bug here specifically related to dragging and dropping into the editor.

It does eventually prevent the upload of additional files, but often not until it's already uploaded too many.
 
I just tested again without addons and still the issue, but would would not let me upload any more than 6 (with max limit of 5 ) so maybe there is an addon that is in play as well.

Anyway, good that you've managed to find the bug.
 
Aren't lots of those duplicates ?

Indeed they do seem to be. I just heard back from my query to the member:

"I didn't intend all those photos - they just appeard when I clicked from large size to thumbnail "

So in this case it appears they be yet a different bug duplicating images once uploaded when you click on the editor for full or thumb.
 
@Digital Doctor spotted something that I missed, but it was sort of something I was hinting about earlier.

I wondered whether the ATTACH BB code had been brought in from another post, such as the user copying and pasting the code or quoting a post containing it and using that. Hence why I asked about whether the images were showing or whether it was just a link to the attachments.

But the ATTACH code you posted makes it quite clear:
Code:
[ATTACH=full]7953[/ATTACH] [ATTACH=full]7954[/ATTACH] [ATTACH=full]7955[/ATTACH] [ATTACH=full]7956[/ATTACH] [ATTACH]7957[/ATTACH] [ATTACH]7953[/ATTACH] [ATTACH]7954[/ATTACH] [ATTACH]7955[/ATTACH] [ATTACH]7956[/ATTACH] [ATTACH]7957[/ATTACH] [ATTACH]7953[/ATTACH] [ATTACH]7953[/ATTACH] [ATTACH]7954[/ATTACH] [ATTACH]7955[/ATTACH] [ATTACH]7956[/ATTACH] [ATTACH]7957[/ATTACH]

There is only 5 unique attachments on that post. Only 5 attachments have been uploaded.

You can insert the same attachment into your post as many times as you like, that's not what the limit is for. The limit is merely in place to restrict the number of unique attachments you can upload to a post.

So, ironically, that post is not a manifestation of the bug at all. But, in the process of troubleshooting that, we did actually find a genuine bug so that's all worked out quite well :)
 
No, he didn't copy and paste.

It seems the duplicates happened by accident when he clicked on the full/thumb buttons - so I think that may be a either different bug or just that the full/thumb system is not as user friendly as it could be. I think I know exactly what happened, if you click on full image it inserts them, but then you change your mind and want thumbnails, so you click on thumbnails thinking it will change it from full to thumb, but it doesn't - it just adds a duplicate.

Although I presume this would not be counted as a bug, it's a bit counterintuitive. I think it should be an either or situation, not allowing duplicates to be entered



000801_0113_0023_tslsw.webp 000801_0113_0023_tslsw.webp 000801_0178_0019_tslsw.webp 000801_0181_0047_tslsw.webp 000801_0113_0023_tslsw.webp 000801_0178_0019_tslsw.webp 000801_0181_0047_tslsw.webp
 
It wouldn't be unusual for people to want to deliberately insert the same image twice or more. Rare but certainly not something we would want to prevent.
 
So I've fixed the specific situation that triggered this. Dropping files now uploads in serial rather than in parallel.

Technically the race condition that causes this still exists, but it's rather difficult to prevent and, frankly, doesn't have a ton of benefit (in the grand scheme) because people can generally just make a second post with the files. It's something that would basically have to be triggered outside of the browser though (through direct HTTP requests).
 
Top Bottom