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

"Initial data from service" attempts to migrate data even if response is empty #3935

Closed
ebruchez opened this Issue Feb 6, 2019 · 5 comments

Comments

1 participant
@ebruchez
Copy link
Collaborator

ebruchez commented Feb 6, 2019

It's a strange case:

  • service is called upon new
  • response is blank and doesn't have (presumably) a Content-Type
  • response appears successful and dispatches xforms-submit-done
  • we attempt to migrate the (not-replaced) data in xxf:instance('fr-form-instance')

This causes nested repeated grid iterations.

+1 from customer

"Initial data from service" doc.

@ebruchez ebruchez added the Form Runner label Feb 6, 2019

@ebruchez ebruchez self-assigned this Feb 6, 2019

@ebruchez ebruchez added this to To review in Orbeon Forms 2019.1 via automation Feb 6, 2019

@ebruchez ebruchez added this to To review in Orbeon Forms 2018.2.1 via automation Feb 6, 2019

@ebruchez

This comment has been minimized.

Copy link
Collaborator Author

ebruchez commented Feb 7, 2019

  • repro failing case locally
  • fix
  • backport to customer branch
  • consider backport to 2018.1-pe and 2017.2-pe
  • doc that if successful but empty (no content-type), ignored
  • follow-up: pass params to fr-get-instance-from-service without using fr-service-parameters
@ebruchez

This comment has been minimized.

Copy link
Collaborator Author

ebruchez commented Feb 7, 2019

Confirming that calling a service which doesn't return a Content-Type AND doesn't return a response body causes xforms-submit-done to run.

@ebruchez ebruchez closed this in 08992d3 Feb 7, 2019

Orbeon Forms 2019.1 automation moved this from To review to Done Feb 7, 2019

Orbeon Forms 2018.2.1 automation moved this from To review to Done Feb 7, 2019

@ebruchez

This comment has been minimized.

Copy link
Collaborator Author

ebruchez commented Feb 7, 2019

Also confirming that we use application/xml as default response mediatype in case none is provided.

@ebruchez

This comment has been minimized.

Copy link
Collaborator Author

ebruchez commented Feb 7, 2019

And also confirming that if there is no content in the response, we dispatch an xforms-submit-done anyway without looking at the response Content-Type. XForms 1.1 says:

For a success response not including a body, submission processing concludes after dispatching xforms-submit-done with appropriate context information.

It'd be nice to know whether instance replacement has taken place, though! The workaround is to use replace="none", and use event("response-body") to test whether it contains an XML node.

XForms 2.0 says:

For success responses, if the response does not include a body, submission succeeds;

@ebruchez

This comment has been minimized.

Copy link
Collaborator Author

ebruchez commented Feb 7, 2019

ebruchez added a commit that referenced this issue Feb 7, 2019

@ebruchez ebruchez added this to Todo in Orbeon Forms 2018.1.4 via automation Feb 7, 2019

@ebruchez ebruchez moved this from Todo to Done in Orbeon Forms 2018.1.4 Feb 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment