Closed zachsa closed 1 year ago
Identified the download error:
node:events:490
throw er; // Unhandled 'error' event
^
TypeError: Cannot destructure property 'grid1' of 'fixGridValues(...)' as it is undefined.
at default (file:///home/zach/code/saeon/repositories/national-climate-change-response-database/src/api/src/http/download-submissions/parse-row/parse-progress-data/index.js:15:11)
at parseValue (file:///home/zach/code/saeon/repositories/national-climate-change-response-database/src/api/src/http/download-submissions/parse-row/index.js:67:35)
at default (file:///home/zach/code/saeon/repositories/national-climate-change-response-database/src/api/src/http/download-submissions/parse-row/index.js:156:14)
at Request.<anonymous> (file:///home/zach/code/saeon/repositories/national-climate-change-response-database/src/api/src/http/download-submissions/index.js:138:36)
at Request.emit (node:events:512:28)
at Request.<anonymous> (/home/zach/code/saeon/repositories/national-climate-change-response-database/src/api/node_modules/mssql/lib/tedious/request.js:631:20)
at Request.emit (node:events:512:28)
at Request.emit (/home/zach/code/saeon/repositories/national-climate-change-response-database/src/api/node_modules/tedious/lib/request.js:150:18)
at RequestTokenHandler.onRow (/home/zach/code/saeon/repositories/national-climate-change-response-database/src/api/node_modules/tedious/lib/token/handler.js:457:20)
at Readable.<anonymous> (/home/zach/code/saeon/repositories/national-climate-change-response-database/src/api/node_modules/tedious/lib/token/token-stream-parser.js:26:33)
Emitted 'error' event on Readable instance at:
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Node.js v19.8.1
Regarding the download error, there is a submission that contains an invalid 'endDate' for the emissions progress calculator. I've improved error handling to allow for this and similar problems. In this case, in the download if a calculator or other field has an error the form content then the details of this error will be included in the cell instead of the value.
The problematic submission is here: http://nccrd.environment.gov.za/submissions/CC3E433E-F36B-1410-867E-00528B626FB9
Regarding the differences in the counts, I am not able to reproduce the bug. I have tried the following:
With 2 windows open (one as admin, one as incognito)