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

nunaliit schemas-for-inreach command ignores form versioning #964

Open
ahayes opened this issue Oct 27, 2021 · 1 comment · Fixed by #1141
Open

nunaliit schemas-for-inreach command ignores form versioning #964

ahayes opened this issue Oct 27, 2021 · 1 comment · Fixed by #1141
Labels
Enhancement Desired improvement to design or implementation that adds value.
Milestone

Comments

@ahayes
Copy link
Member

ahayes commented Oct 27, 2021

Currently the nunaliit schemas-for-inreach command outputs JSON containing all the definition objects for schemas related to a inreach_forms.xml file found in the config folder.

In the XML document, forms have an id number, a title, and a prefix. By convention, a best practice for building forms would have the prefix include a version number to uniquely identify a form. The inreach form XML in the example below shows and example of the syntax. The form id which functions as more of an index in the file and cannot be assumed to be consistent over time. The title may well remain consistent despite changes to the form fields. The prefix contains a unique form identifier with an abreviation representing the atlas, the form title, and the version (in this case 1). The schema IDs for each form should be based on the entire prefix to permit versioning of forms and with new versions resulting in new matching schemas.

<form id="9">
<title>Weather Conditions</title>
<destination>[email protected]</destination>
<prefix>EX-WC-1-</prefix>
<delimiter>|</delimiter>
<field id="1">
<name>Observed</name>
<type>PickList</type> 
<value>Blowing snow</value>
<value>White out</value>
<value>Blizzard</value>
<value>Flat light</value>
<value>Ice fog</value>
<value>Fog</value>
<value>Excellent visibility</value>
<value>Good visibility</value>
<value>Fair visibility</value>
<value>Poor visibility</value>
<value>Bad visibility</value>
<value>Zero visibility</value>
<value>Falling snow</value>
<value>Rain</value>
<value>Freezing rain</value>
<value>Other (put in notes)</value>
<required>Y</required>
</field>
<field id="2">
<name>Notes</name>
<type>Text</type>
<length>140</length>
<required>N</required>
<default></default>
</field>
</form>

The schema IDs for each form should be based on the entire prefix to permit versioning of forms with matching schemas.

@alexgao1
Copy link
Contributor

alexgao1 commented Aug 4, 2023

Reverted with: #1174
Versioning of schemas requires that all existing schemas to be updated as well in addition to every reference to affected schemas in the client side code. It would also require references to the old schemas that don't use the versioning be added everywhere as well.

This is because adding the new IDs for schemas with prefix + title needs the inReach processing servlet to also check for that instead of only checking title. The servlet could be changed to query for the existence of a particular schema then check the alternative (check if prefix+title exists, otherwise check if it's title only), but is not ideal to be querying the database for every inReach message processed. Caching them is also difficult because there is no indication if it was updated with the executable.

@alexgao1 alexgao1 reopened this Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Desired improvement to design or implementation that adds value.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants