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

Upload sometimes doesn't immediately show file metadata after completion #4433

Closed
ebruchez opened this issue Feb 18, 2020 · 3 comments
Closed

Upload sometimes doesn't immediately show file metadata after completion #4433

ebruchez opened this issue Feb 18, 2020 · 3 comments

Comments

@ebruchez
Copy link
Collaborator

@ebruchez ebruchez commented Feb 18, 2020

I finally reproduced this locally using throttling:

  • form with 2 file attachment controls
  • attach file to first one
  • before upload has completed (throttling), attach second file
  • click on the page outside controls
  • wait for uploads to terminate

But I don't always reproduce it.

+1 from customer

@ebruchez

This comment has been minimized.

Copy link
Collaborator Author

@ebruchez ebruchez commented Feb 18, 2020

So far I still don't reproduce it consistently. But I did reproduce it once, and in executeNextRequest() the nested condition probably evaluated to false. Now we need to figure out why.

@ebruchez

This comment has been minimized.

Copy link
Collaborator Author

@ebruchez ebruchez commented Feb 18, 2020

I reproduce this better when throttling at 64 kbps.

The scenario is that the last xxforms-upload-progress event is in progress just at the time the upload response completes. So the executeNextRequest() for xxforms-server-events finds Globals.requestInProgress == true, which is expected.

However, once xxforms-upload-progress completes, it should check the queue again, but it doesn't.

The reason is that we set Globals.requestInProgress = false as a side-effect of running Support.fetchText, but our Future's onComplete which actually handles the Ajax response runs before that side-effect. So it sees Globals.requestInProgress == true still.

The order of onComplete is not guaranteed. We could use andThen instead.

@ebruchez

This comment has been minimized.

Copy link
Collaborator Author

@ebruchez ebruchez commented Feb 18, 2020

To reproduce, the key is to have a very slow connection to maximize the chances that the xxforms-upload-progress will overlap the end of the upload. A single upload control is enough to reproduce.

@ebruchez ebruchez added this to In progress in Orbeon Forms 2019.2.1 Feb 18, 2020
@ebruchez ebruchez closed this in 8024e1b Feb 18, 2020
@ebruchez ebruchez moved this from In progress to Done in Orbeon Forms 2019.2.1 Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.