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
Work out what we want to do with Enketo XML, and do that thing #5549
Comments
Scheduling for 4.0.0 because that's the ideal time to do any data migrations that may be necessary for this. |
@dianabarsan assures me that we can reverse engineer from JSON to XML so we should just do that. |
Is it possible to split this issue into two?
If I understand the approach correctly, this would allow us to discuss scheduling the first issue in a 3.x timeframe and would be beneficial to new projects (and old). |
Yes, I should have updated this issue so it now only covers step 1. We've decided not to run any major migrations in 4.0.0 so step 2 will have to wait until 5.0.0, and/or be provided as a custom script that each project can choose to run, or not. |
So if we are just converting JSON to XML and not attaching the XML to new reports, is this regarded as a breaking change? |
It depends on the implementation, because we may need to store more information to completely reproduce the xml, but in all likelihood it's not a breaking change. |
This is ready for AT on There should be no difference for the user when filling or editing forms. You should be able to:
There are a few caveats:
|
Curious - after getting this fix via an upgrade to 4.0, would projects be able to remove attachments from the reports created via 3.x versions without breaking anything? |
Mixed. Yes for the most part, with one exception.
Quote from PR description: #7596 So, for reports that created other docs (extra docs), if the attachment was removed, the information about the "extra docs" is lost (the docs themselves exist in the database already). Editing those reports is actually already broken (one of the caveats). Deleting attachments from existent reports and saving them, if partners decide to do this, should be one of the test scenarios! |
|
Instead of relying on xml attachments, uses report fields to populate form model on report edits. Some changes have been required: (1) db-doc fields will be saved in the main report fields. To maintain old report content display, these fields will become "hidden". (2) Because of (1), it's not safe to default to using fields when editing a report that has a content attachment, so if the content attachment exists, it will be used to populate the form, but it will be deleted upon saving. (3) bindJsonToXml is refactored so it treats arrays (repeats) correctly. Limitations: - Editing a report that created extra docs duplicates all extra docs #7594 - this behavior existed before - Reports created as extra docs in forms are not editable #7605 - the additional context part - Reports created as extra docs might not always be faithful to the model of the form itself. Migrates a bunch of e2e tests from protractor to wdio. #5549
Merged to |
When creating reports we store the user-entered data effectively twice:
doc.fields.{}
, for use by everything else (on-screen display, configurable logic like rules and schedules, impact and analytics via couch2pg, etc)Originally we stored the XML in the
doc.xml
property, as a string.We later realised that this is inefficient / unhelpful, because CouchDB's view generation performance is a function of the size of a JSON document, and nothing refers to it except editing. So, we moved it into an attachment.
However, this has caused other performance problems:
We need to work out what to do here.
Obvious options include:
doc.fields
object when we want to edit (hat-tip @dianabarsan for that brilliant suggestion)Diana's suggestion sounds ideal, and IMO should be investigated first, but it can be up for discussion.
Context: https://docs.google.com/document/d/1kXjsF-orndz0-V5UFf_Esx5J-ogeQ6_tALCwE1K0tvA/edit#heading=h.29bkt8nfi7kw
The text was updated successfully, but these errors were encountered: