International-Aerobatic-Club / iaccdb

IAC Aerobatic Contest Database
iaccdb.iac.org
1 stars 1 forks source link

Validate values in the JaSPer XML uploads #244

Open djmolny opened 1 year ago

djmolny commented 1 year ago

The uploads (power & glider) for the 2022 U.S. National Aerobatic Championships populated the <Region> element with the value USNationals. In prior years, that value was National and that is hard-coded into IACCDB. As a result, those events were not given the correct treatment in the Regional Series calculations.

IACCDB should validate as many data elements in the XML file as possible, using lists of legitimate values where possible (e.g., <Region>) and sanity checks elsewhere (e.g., contest start date may not be in the future).

djmolny commented 1 year ago

Follow-up: What happens if/when invalid data is found? Because the contest data is uploaded as a complete file and processed by an asynchronous daemon, there's no opportunity to inform JaSPer that the submittion was bad. IACCDB could send an email, although it's unclear who the recipient(s) should be -- perhaps webmaster@iac.org? And/or IACCDB could display the contest as invalid on the home page.

djmolny commented 1 year ago

CORRECTION: JaSPer transfers the contest data via HTTP POST, not a file upload. Therefore IACCDB could fail the POST operation if it contains invalid data. The question is what happens after that? JaSPer would have to present the error message to the end user, who will probably be ill-equipped to understand it... let alone fix it.