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

Autosave during upload can cause an error #4003

Closed
ebruchez opened this issue Mar 22, 2019 · 5 comments

Comments

Projects
2 participants
@ebruchez
Copy link
Collaborator

commented Mar 22, 2019

Form to reproduce the issue: form.txt.

+1 from customer

@ebruchez ebruchez self-assigned this Mar 22, 2019

@ebruchez ebruchez added this to To do in Orbeon Forms 2018.2.3 via automation Mar 22, 2019

@ebruchez ebruchez added this to To review in Orbeon Forms 2019.1 via automation Mar 22, 2019

@avernet

This comment has been minimized.

Copy link
Collaborator

commented Mar 23, 2019

The message in the log is "instance to submit has at least one pending upload". On autosave, we run the autosave process declared in properties-internal.xml, which does just a save(draft = "true"), hence the error is understandable.

I am trying to reproduce the problem, however, strangely, the autosave during the file upload is working for me. More debugging required.

@avernet

This comment has been minimized.

Copy link
Collaborator

commented Mar 23, 2019

Strangely (?), when I try to reproduce this, the following, in XFormsModelSubmission.java returns false:

SubmissionUtils.hasBoundRelevantPendingUploadControls(
    containingDocument, 
    p.refContext().refInstanceOpt()
)
@avernet

This comment has been minimized.

Copy link
Collaborator

commented Mar 24, 2019

In the above expression, p.refContext().refInstanceOpt() returns None. The submission is fr-create-update-submission in universal-submission.xml, which has a ref="event('holder')", and I imagine that this context isn't tied to an instance.

On a normal save, we call require-uploads, which runs pending-uploads, which checks that inScopeContainingDocument.countPendingUploads > 0, which fails (as it should) when we have a pending upload.

With our latest code things seem to be working:

  • The autosave works while the file upload is in progress. If closing the page before the upload is finished and loading the autosaved data, we get the value for all the fields, except the files (and the holders are empty; they don't contain a file:/ URL).
  • The autosave is done again after the file is uploaded.

One possibility is that the customer runs a version of Orbeon Forms where the test for pending uploads during the submission "works", which cause the problem they are seeing. We asked them what version they are running to we can verify this hypothesis by doing a test against that version.

@ebruchez

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 25, 2019

So there still is a problem with the latest code right? If there is a background upload, countPendingUploads > 0 should return true.

@ebruchez ebruchez moved this from To do to In progress in Orbeon Forms 2018.2.3 Mar 25, 2019

@ebruchez ebruchez assigned avernet and unassigned ebruchez Mar 25, 2019

@avernet

This comment has been minimized.

Copy link
Collaborator

commented Apr 10, 2019

I forgot we already had an issue for this, and consequently created #4012, which is now fixed. So closing this one.

@avernet avernet closed this Apr 10, 2019

Orbeon Forms 2019.1 automation moved this from To review to Done Apr 10, 2019

Orbeon Forms 2018.2.3 automation moved this from In progress to Done Apr 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.