Open JannikStreek opened 1 week ago
Seems like he's trying to access the map again after redirect for some reason:
http.service.ts:19 GET https://4200.code.soeren.codes/api/maps/e650c758-87e3-4bbb-9098-9330b6d395bc 500 (Internal Server Error)
Actually, this will be fixed in #288. When deleting the map, it calls window.location.reload()
, which obviously just tries to access a non-existant map. Since we're reworking the method to add a toast when deleting anyway, we might as well fix it in there by redirecting to /
instead of calling window.location.reload()
.
This is fixed in latest main.
looks good. I would expand the issue a bit: If a map is deleted and later accessed with the old (deleted) uuid by the user, I can see this is in the logs:
[0] [Nest] 511 - 06/24/2024, 1:05:13 PM ERROR [WsExceptionsHandler] undefined
[0] [Nest] 511 - 06/24/2024, 1:05:13 PM ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'name')
[0] TypeError: Cannot read properties of undefined (reading 'name')
[0] at /home/node/app/teammapper-backend/src/map/controllers/maps.controller.ts:25:13
[0] at processTicksAndRejections (node:internal/process/task_queues:95:5)
[0] at MapsController.findOne (/home/node/app/teammapper-backend/src/map/controllers/maps.controller.ts:24:17)
[0] at /home/node/app/teammapper-backend/node_modules/@nestjs/core/router/router-execution-context.js:46:28
[0] at /home/node/app/teammapper-backend/node_modules/@nestjs/core/router/router-proxy.js:9:17
Exception is fine, but it should state that the map is not existing. In addition, the user is redirected correctly to the start page but a toast is missing that the map does not exist.
I think that's a more general issue of not good enough error handling when accessing a non-existant map - I imagine the same thing happens when trying to access /map/abcdefgh
. Maybe a separate issue and PR is better?
Describe the bug When a map is deleted, this error shows up in the console:
Everything else works as expected. But we don't need to raise an error for something that actually worked.
To Reproduce Steps to reproduce the behavior:
Expected behavior No errors are thrown when deleting a map.