NASA-AMMOS / aerie

A software framework for modeling spacecraft.
https://nasa-ammos.github.io/aerie-docs/
MIT License
73 stars 19 forks source link

Aerie AMPCS parsing fails on empty and self-closing tags #1466

Closed cartermak closed 5 months ago

cartermak commented 5 months ago

Checked for duplicates

Yes - I've already checked

Is this a regression?

No - This is a new bug

Version

2.11.0

Describe the bug

When uploading a command dictionary with empty or self-closing XML tags, I get an error from (I think) the sequencing server that looks to be coming from the AMPCS dictionary parsing module.

Reproduction

Upload an XML dictionary with empty or self-closing XML tags (e.g., <description></description> or <description/>). Aerie will fail to parse the dictionary. Stack trace from error response included below.

Logs

TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at Module.parse (file:///app/node_modules/@nasa-jpl/aerie-ampcs/dist/index.js:315:62)
    at file:///app/build/app.js:110:38
    at Layer.handleRequest (/app/node_modules/router/lib/layer.js:101:15)
    at next (/app/node_modules/router/lib/route.js:142:13)
    at Route.dispatch (/app/node_modules/router/lib/route.js:107:3)
    at handle (/app/node_modules/router/index.js:421:11)
    at Layer.handleRequest (/app/node_modules/router/lib/layer.js:101:15)
    at /app/node_modules/router/index.js:288:22
    at processParams (/app/node_modules/router/index.js:568:12)
    at next (/app/node_modules/router/index.js:282:5)

System Info

Local or AWS Aerie deployment; Firefox on MacOS.

Severity

Moderate

dandelany commented 5 months ago

Thanks @cartermak - I have a PR with a fix for this in the underlying aerie-ampcs repository, will update again once it's reviewed and released.

dandelany commented 5 months ago

Remaining to do before this is fully fixed: