At the start of TinyPilot, I didn’t really understand how to use fetch, so I didn’t know how to distinguish between the server responding successfully and returning an error (e.g., an HTTP 400) and the network failing so that it triggered the catch
As a hacky, temporary workaround, I made sure that all of my server API endpoints returned a JSON object with success and error fields, so the JavaScript code ignored the HTTP code and only looked at the JSON objects.
This was silly because the code would return HTTP 200 but then return an error in the HTTP body
The problem is that during an update, the server changes to the new semantics, but the JavaScript in the browser hasn’t updated yet, so it’s still expecting the success and error fields in the response and it rejects responses that don’t have them, so updates broke because they need to query the new backend to verify that the update succeeded, except they didn’t recognize the response.
Fix is that the backend now has to include those extraneous fields for backwards compatibility
Reviewed a PR that fixed a bug in CA cert checking on OS X
Fixed a bug on the website where it failed to show a warning when the user purchased redundant products