API responses only give 200 success #1113
-
I was looking at the code in backend/pb/handlers.go (specifically, as mentioned in this comment) and it appears that a 200 OK response is returned by the API even in scenarios where the internal operation might have failed. I'm curious about the motive behind this implementation. Was this an intentional design choice, or could it have been an oversight? If it wasn't the intended behavior, I would be happy to look into providing a fix for this to ensure the API returns more accurate status codes reflecting the actual outcome of the requests. @seriousm4x Thank you for your work on UpSnap! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Looking back at my own code, I no longer understand why I chose to use goroutines and immediately return a 200 OK response. But your explanation makes more sense, and I've made the changes accordingly. 20e274d Will create a new beta shortly. |
Beta Was this translation helpful? Give feedback.
Looking back at my own code, I no longer understand why I chose to use goroutines and immediately return a 200 OK response.
I think the idea was to have the response reflect that the request was received, rather than whether the device action actually succeeded.
But your explanation makes more sense, and I've made the changes accordingly. 20e274d
Will create a new beta shortly.