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

File Picker Result in WebApp returns cancelled even files are picked on slow networks #1202

Open
1 of 4 tasks
getr11 opened this issue Dec 30, 2022 · 6 comments
Open
1 of 4 tasks
Assignees
Labels
feature-candidate This issue might result in a feature to be implemented new issue An issue that hasn't yet been seen from the maintainer web Issue applies to Web platform

Comments

@getr11
Copy link

getr11 commented Dec 30, 2022

Describe the bug
Sporadically the timeout in the following function is reached in a WebApp when selecting files from slow networks (VPN connection,
...) Thus it looks like the dialog is cancelled even files are selected. Since this happens sporadically I think I am sometimes slightly above the 500ms, Of course the timeout can be extended in src code thus the selection will work with the drawback that the cancel detection takes longer.

This is the code part causing the issue

// This listener is called before the input changed event,
  // and the `uploadInput.files` value is still null
  // Wait for results from js to dart
  Future.delayed(Duration(milliseconds: 500)).then((value) {
    if (!changeEventTriggered) {
      changeEventTriggered = true;
      filesCompleter.complete(null);
    }
  });
}`

Solutions:
Seperate cancel from file picking. If files are picked wait until data is completed.
Provide the timeout value as parameter of the pickFiles() function

Platform

  • Android
  • iOS
  • Web
  • Desktop

Version
file_picker 5.2.4

@getr11 getr11 added the new issue An issue that hasn't yet been seen from the maintainer label Dec 30, 2022
@guidotheelen
Copy link
Contributor

I also encountered this bug. I'm unable to select a file when running the file-picker on a virtual machine with the following configuration:

OS: Windows 10 (64Bit)
Base Mem: 8000MB
Processor: 1 CPU

This suggests the problem can also be reproduced with a slow computer instead of a slow network.

Both proposed solutions would work for me 👍

@github-actions
Copy link

This issue is stale because it has been open for 14 days with no activity.

@github-actions github-actions bot added the stale label Jan 13, 2023
@getr11
Copy link
Author

getr11 commented Jan 13, 2023

I just want to bring up this topic again because for web apps this is a big issue....

@github-actions
Copy link

This issue is stale because it has been open for 14 days with no activity.

@github-actions github-actions bot added the stale label Jan 21, 2023
@github-actions
Copy link

github-actions bot commented Feb 5, 2023

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as completed Feb 5, 2023
@philenius philenius added feature-candidate This issue might result in a feature to be implemented web Issue applies to Web platform labels Apr 12, 2023
@philenius philenius reopened this Apr 12, 2023
@github-actions github-actions bot removed the stale label Apr 13, 2023
@miguelpruivo
Copy link
Owner

Any news on this? @philenius ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-candidate This issue might result in a feature to be implemented new issue An issue that hasn't yet been seen from the maintainer web Issue applies to Web platform
Projects
None yet
Development

No branches or pull requests

4 participants