OpenClinica / enketo-oc

OpenClinica's fork of the Enketo web forms monorepo
Apache License 2.0
0 stars 1 forks source link

Headless mode not able to create autoqueries, calls timeout #35

Open pbowen-oc opened 1 year ago

pbowen-oc commented 1 year ago

6.0.0.oc-5

Headless mode is able to open forms and save data (if a calculation calls for it), but it is not able to save autoqueries. This occurs for forms opened with POST /instance/headless or POST /instance/headless/rfc

Steps:

  1. Open this XForm ( Headless failure XForm.xml.txt ) with this instance ( Headless failure instance.xml.txt ) using POST /instance/headless

Expected: The form adds an autoquery to the data item that violates the constraint and the call completes without error.

Actual: No autoquery is added. The call returns an error code after 5 minutes (which is our current headless timeout).

MartijnR commented 1 year ago

failing (with autoquery)

curl --user enketorules: -d "server_url=http://localhost:3000&form_id=Headless.failure&ecid=a&instance_id=b&instance=<data xmlns:oc=\"http://openclinica.org/xforms\"  xmlns:enk=\"http://enketo.org/xforms\" ><int1>100</int1><observation_id>test</observation_id><meta><instanceID>uuid:1234</instanceID><instanceID_comment/></meta><int1_comment>{\"queries\":[],\"logs\":[{\"type\":\"audit\",\"message\":\"Value changed from \\\"\\\" to \\\"100\\\"\",\"user\":\"root\",\"date_time\":\"2023-04-19 17:18:59.068 Z\"}]}</int1_comment><observation_id_comment/></data>" http://localhost:8005/oc/api/v1/instance/headless

not failing (no autoquery):

curl --user enketorules: -d "server_url=http://localhost:3000&form_id=Headless.failure&ecid=a&instance_id=b&instance=<data xmlns:oc=\"http://openclinica.org/xforms\"  xmlns:enk=\"http://enketo.org/xforms\" ><int1>151</int1><observation_id>test</observation_id><meta><instanceID>uuid:1234</instanceID><instanceID_comment/></meta><int1_comment>{\"queries\":[],\"logs\":[{\"type\":\"audit\",\"message\":\"Value changed from \\\"\\\" to \\\"100\\\"\",\"user\":\"root\",\"date_time\":\"2023-04-19 17:18:59.068 Z\"}]}</int1_comment><observation_id_comment/></data>" http://localhost:8005/oc/api/v1/instance/headless

headless URL: http://localhost:8005/edit/fs/headless/154315abe283fcd7be162a203c8b701e?ecid=a&instance_id=b

findings

failing with rfc:

curl --user enketorules: -d "server_url=http://localhost:3000&form_id=Headless.failure&ecid=a&instance_id=b&instance=<data xmlns:oc=\"http://openclinica.org/xforms\"  xmlns:enk=\"http://enketo.org/xforms\" oc:complete=\"true\"><int1>100</int1><observation_id>test</observation_id><meta><instanceID>uuid:1234</instanceID><instanceID_comment/></meta><int1_comment>{\"queries\":[],\"logs\":[{\"type\":\"audit\",\"message\":\"Value changed from \\\"\\\" to \\\"100\\\"\",\"user\":\"root\",\"date_time\":\"2023-04-19 17:18:59.068 Z\"}]}</int1_comment><observation_id_comment/></data>" http://localhost:8005/oc/api/v1/instance/headless/rfc

headless RFC URL: http://localhost:8005/edit/fs/rfc/headless/154315abe283fcd7be162a203c8b701e?ecid=a&instance_id=b

kkrumlian commented 11 months ago

Can we verify this is also working properly on the master branch as part of validation.