biigle / user-storage

:m: BIIGLE module to offer file upload and storage for users
GNU General Public License v3.0
0 stars 0 forks source link

Add skip and retry option for failed file uploads #30

Closed lehecht closed 5 months ago

lehecht commented 6 months ago

Closes #11.

lehecht commented 6 months ago

@mzur I just noticed that $success never becomes true here, because in case of success a string is returned. The only bool that can be returned is false. So even when the upload was successfull it does not stop the loop. Should I change that?

mzur commented 6 months ago

Yes, good catch! I think $success !== false should do the trick.

lehecht commented 6 months ago

@mzur

Somehow I produced an inconsistent state when I combined duplicate files with failed files. I uploaded files A and B first. Then I created a new storage request with files A, B and C. File A intentionally failed, file B was detected as duplicate and file C succeeded. However, now both panels (files failed and duplicate files) are shown and I can click on "retry" but nothing happens. A second run (without failure) worked fine.

Did you upload file A and B in one directory of one request? If yes, how did you make file A fail? I'm a bit confused, because file A should also be recognized as duplicate, like B. Or did I get you wrong?

mzur commented 6 months ago

If yes, how did you make file A fail? I'm a bit confused, because file A should also be recognized as duplicate, like B.

I added a random throw new Exception() in the StoreStorageRequestFile::rules() method, so the failure occurred before the duplicate check.

mzur commented 6 months ago

The compiled src/public/ files are also still missing.

lehecht commented 6 months ago

@mzur How should a storage request be handled if all files have been uploaded successfully, but the request couldn't be updated in the end?

Currently, only the handleErrorResponse method is used. Should I add there also a retry button?

mzur commented 6 months ago

No, just keep it like that. The user should be able to click submit again (right?). Also, they could reload the page and find the storage request still pending. Then they can click submit again, too.

lehecht commented 5 months ago

@mzur

Some previous comments are not resolved yet. Also, I don't see the failed/duplicate file states in the UI any more (i.e. changed color and icon):

I don't know how to reproduce this bug. For me everything seems to work. Can you describe what you did?

mzur commented 5 months ago

I don't know how to reproduce this bug. For me everything seems to work. Can you describe what you did?

You are right. I pulled the recent changes and recompiled the assets. Now it works again. Maybe my biigle/core assets haven't been up to date...