WebUI: Certain incorrect imports trigger TypeError on server #3043

Closed
opened 2025-11-18 01:27:25 -08:00 by Animan8000 · 0 comments
Contributor

If the user does a mistake like:

{
  "Created": "2013-01-01T00:00:00.000+00:00"
}

Then the WebUI won't give any feedback and the server gets an error in the console.

2025-11-18T10:25:50:851 [0.1.0] error:  TypeError: Cannot read properties of undefined (reading '$numberLong') while processing /custom/import request
    at fromMongoDate (D:\GitHub\spaceninjaserver\src\helpers\inventoryHelpers.ts:57:41)
    at importInventory (D:\GitHub\spaceninjaserver\src\services\importService.ts:397:23)
    at importController (D:\GitHub\spaceninjaserver\src\controllers\custom\importController.ts:18:9)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
2025-11-18T10:25:50:852 [0.1.0] http:   POST /custom/import?accountId=691b5ef71a40a7cc89e03ee2&nonce=2391468551978802&wsid=1 500 8.725 ms - -
2025-11-18T10:26:10:014 [0.1.0] http:   GET /dynamic/worldState.php?buildLabel=2025.09.02.14.13/C1uuuxHFA5pFWj3h1OydPA 200 6.322 ms - 57353
If the user does a mistake like: ``` { "Created": "2013-01-01T00:00:00.000+00:00" } ``` Then the WebUI won't give any feedback and the server gets an error in the console. ``` 2025-11-18T10:25:50:851 [0.1.0] error: TypeError: Cannot read properties of undefined (reading '$numberLong') while processing /custom/import request at fromMongoDate (D:\GitHub\spaceninjaserver\src\helpers\inventoryHelpers.ts:57:41) at importInventory (D:\GitHub\spaceninjaserver\src\services\importService.ts:397:23) at importController (D:\GitHub\spaceninjaserver\src\controllers\custom\importController.ts:18:9) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) 2025-11-18T10:25:50:852 [0.1.0] http: POST /custom/import?accountId=691b5ef71a40a7cc89e03ee2&nonce=2391468551978802&wsid=1 500 8.725 ms - - 2025-11-18T10:26:10:014 [0.1.0] http: GET /dynamic/worldState.php?buildLabel=2025.09.02.14.13/C1uuuxHFA5pFWj3h1OydPA 200 6.322 ms - 57353 ```
Sainan added the improvement label 2025-11-18 01:29:51 -08:00
Sainan added the pr'd for label 2025-11-18 01:36:22 -08:00
Sign in to join this conversation.