manyfold3d / manyfold

A self-hosted digital asset manager for 3d print files.
https://manyfold.app
MIT License
781 stars 50 forks source link

Unfair duplicate errors with parametric modals #3074

Open BoyvdR opened 1 day ago

BoyvdR commented 1 day ago

Describe the bug Models that have variations or a collection of modals will gave the duplicate error after uploading them. Think of models like Gridfinity, which have different sizes in width and height, but with similair names (1x1x1, 1x1x2, 1x1x3, 1x2x1 etc) will gave a duplicate error.

To Reproduce Steps to reproduce the behavior:

  1. Go to /models/new
  2. Click on browse files or upload a large collection of modals which are similair name
  3. Click on Create modals
  4. See error under /problems

Expected behavior No duplicate error. The files are not the same size or aren't the same file. Or let the 3d model be shown like all the none duplicate files but with a "possible duplicate" tag.

Screenshots image image

BoyvdR commented 1 day ago

The issue seems to be in the uploading the files via de drag and drop interface.. So it only happens when you use the drag and drop with a large amount of files. So the filename isn't the issue

I use the brave browser on pop-os with the Dolphin file explorer.

Floppy commented 1 day ago

That's interesting, because duplicate files are detected by doing an md5 hash of the file contents, which is shown in the digest in the info box. So, things like similar file names shouldn't make a difference. Can you attach a couple of the files, and look to see if the digests are the same on the duplicate models?

Also, do the errors resolve if you press "rescan" on the model page?

And that "Load Error" looks suspicious, that could perhaps be related.

Floppy commented 18 hours ago

Oh! There's the issue! The file size for that files is shown as zero bytes (hence the load error), which will also mean that anything else with 0 length will get the same digest and show as a duplicate. Can you check that the files are not in fact all zero size? Rescan may help if they've been analysed wrong somehow.

I should probably add a different error for files that are zero-length, rather than them showing up as duplicates.

BoyvdR commented 14 hours ago

Yes, that made it a little unclear to me what actually happend.. All the files were bigger then 0, most of them around 2mb, I think. I decided on removing en re uploading them. I can reproduce the issue and then analyze to see if the will be analyze correctly.

That would be nice feature! I was a bit stuck, I saw they where 0 bytes, but thought that was beceaus of some feature made sure that a model only would be taken up in the database if it isn't a duplicate.