Closed jkuester closed 1 day ago
Thanks @jkuester! I'll review this tomorrow. How can I reproduce the issue? Will any form submission in the default
config do?
Thanks! To repro this issue basically all you have to do is open a form using cht-form (e.g. https://github.com/medic/support-scripts/tree/master/cht-form-example ) and check the browser console logs and you should see the errors.
Description
Closes https://github.com/medic/cht-core/issues/9561
More details on source of the problem are in the issue, but TLDR is that a dependency on the
changes.service
leaked into cht-form. Thechanges.service
tries to listen to the db for changes and prints an error if it cannot, before re-trying to listen again. In cht-form, there is no db to listen to and the result is that when cht-form runs, thechanges.service
code just contantly spams error messages to the logs.My fix here is to update the service dependency tree to move some code out of the
extract-lineage.service
(which theenketo.service
needs) and put it in theuser-contact.service
. This essentially removes the dependency on thechanges.service
(and a number of other things not needed byenketo.service
). I think theuser-contact.service
is a reasonable place for this functionality anyway, but I am happy to hear other ideas for how to address this!Additionally, I have added an after-hook to the cht-form integration tests to validate the browser console and check for any unexpected logs. Hopefully this will help catch issues like this in the future.
Code review checklist
Compose URLs
If Build CI hasn't passed, these may 404:
License
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.