Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load multiple data issue #44

Closed
RickyChenTaiwan opened this issue Jun 16, 2021 · 9 comments
Closed

load multiple data issue #44

RickyChenTaiwan opened this issue Jun 16, 2021 · 9 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@RickyChenTaiwan
Copy link

Hi,

Thanks for you provide amazing functionality for us, It's cool! 👍
One question I want to query you:
When I wanted to load multiple files(291files) in usage.py, I got 288 files actually. It seems some files missing, any comment?

Operation step:

  1. Clone this repository in fix-multiupload branch
  2. Running demo page => python usage.py
  3. open web and load 291 files
  4. I got 288 files actually.

Here is running code(usage.py) and result:
image

image

Thanks and best regards,

Ricky H Chen

@fohrloop
Copy link
Owner

Hi! Thank you! As you might have noticed that branch is WIP, but is partly working. Did you check the file paths of the missing files? Is there something in common in them or are they just random files from the chosen location?

@RickyChenTaiwan
Copy link
Author

RickyChenTaiwan commented Jun 17, 2021

Hi @np-8 ,

What is the mean of WIP actually?
Did you check the file paths of the missing files? => yes, I checked the file paths of the missing files. the first 3 files are missing.

I modified code in Upload_ReactComponent.react.js, I added "time sleep" in Upload_ReactComponent.react.js:
image

after added "time sleep", the missing files didn't happen again. I think it's a network transmission problem, return "fileNames" need some time. Am I right? I am not sure actually. ><

Thanks and best regards,

Ricky H Chen

@fohrloop
Copy link
Owner

By WIP I meant "Work In Progress". Okay nice to hear that you found out what could be the reason for the behaviour: the implementation might need some additional checks for each file if they are uploaded or not, and then retry if needed. I'm actually considering to switch from resumable.js to some another (flow.js) JS package, as the resumable.js seems not to be maintained anymore.

@RickyChenTaiwan
Copy link
Author

Got it,

I will keep noticing that, thank you very much XD

Best regards,

Ricky H Chen

@fohrloop fohrloop added the bug Something isn't working label Aug 10, 2021
@sorenwacker
Copy link

Do the files all have the same extension?

@fohrloop
Copy link
Owner

I'm working on this now and have a target for getting this fixed in the next 0.7.0 release. I guess this is related to the same issue I faced here. As the problem is related to timing, it has something to do with file access on server side, and would probably be fixed with simple retries when writing the files.

@fohrloop fohrloop added this to the 0.7.0 milestone Dec 31, 2021
@fohrloop fohrloop self-assigned this Feb 27, 2022
@fohrloop
Copy link
Owner

Hi! This should be fixed in the dev branch in 511557f. I will still some sort of test for the multifile upload function before closing this. The changes are going to be included in the dash-uploader 0.7.0 update.

@fohrloop
Copy link
Owner

Please check out the pre-release (0.7.0a1), by installing it with

python -m pip install dash-uploader --pre

It should have this bug fixed. Note that the callbacks do have different syntax in >=0.7.0, so they should be defined as:

import dash_html_components as html
import dash_uploader as du


@du.callback(
    output=Output("callback-output", "children"),
    id="dash-uploader",
)
def callback_on_completion(status: du.UploadStatus):

    if status.n_uploaded == 0:
        return  # no files uploaded yet.

    print(status)

    out = []
    if status.uploaded_files is not None:
        return html.Ul([html.Li(str(x)) for x in status.uploaded_files])

    return html.Div("No Files Uploaded Yet!")

@RickyChenTaiwan
Copy link
Author

Hi @np-8 ,

Thanks for your development, it is amazing.

Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants