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

Not displaying max_entries error when multiple uploads #2835

Open
dankentfield opened this issue Oct 2, 2023 · 6 comments
Open

Not displaying max_entries error when multiple uploads #2835

dankentfield opened this issue Oct 2, 2023 · 6 comments

Comments

@dankentfield
Copy link

dankentfield commented Oct 2, 2023

Environment

  • Elixir version (elixir -v): 1.13.1
  • Phoenix version (mix deps): 1.7
  • Phoenix LiveView version (mix deps): 0.20
  • Operating system: Mac 12.7
  • Browsers you attempted to reproduce this bug on (the more the merrier): Chrome
  • Does the problem persist after removing "assets/node_modules" and trying again? Yes/no: Yes

Actual behavior

https://gist.github.com/dankentfield/719666ede4370ab7a9a6c511a82b0983

  • Run the script and go to http://localhost:5001/
  • Try uploading 3 files (more then the max_entries)
  • You will see 2 succeed and land in uploaded and 1 stays in pending, however I expect there to be a max_entries error message for this one.
  • If you continue to upload another file it will succeed and add another file to the uploaded files, which now contains more than the max_entries should

Expected behavior

  • Should display the max_entries error when too many files are uploaded (partial success and partial failure).
  • It should never upload more than the max_entries.
@josevalim
Copy link
Member

I am almost sure this change was intentional. Otherwise, if the user wants to add new files, they need to remove the old ones, and select new ones, even when it is clear the old ones won't upload. And this makes the flow very annoying for auto-uploads, especially when drag and drop is enabled.

@dankentfield
Copy link
Author

I'm not sure I understand. It doesn't display the error for the failed uploads so how would the user know there is a problem?

@josevalim
Copy link
Member

It will display once you have more than max_entries succeed.

@dankentfield
Copy link
Author

But that isn't possible because they just sit in the pending upload column (2 will be in completed) 1 will be in pending with no error

@josevalim
Copy link
Member

Oh, I see. It is failing because it is too many entries, not because of other reasons!

SteffenDE added a commit to SteffenDE/phoenix_live_view that referenced this issue Feb 22, 2024
SteffenDE added a commit to SteffenDE/phoenix_live_view that referenced this issue Feb 22, 2024
@SteffenDE
Copy link
Collaborator

Related to #2807.

I think the problem is that since that change we auto upload up to max_entries even if more than max_entries are submitted. After the auto upload the too many files error is removed in recalculate_errors.

So either we don't auto upload in that case or we keep the too many files error in case of auto uploads?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants