after carful considerations I've decided that the best prevention for this bug is a good vs code color theme
I think it can help if you start defining first the input and output, of the system and methods. The system can be defined in OpenAPI, methods with tests (TDD)
Lots of code solutions here but also monitoring subscriber counts and their source could help if something drops off. Observability and logging could have helped identify this issue earlier.
Does podia have rest api docs? It feels like their api is a backend for a frontend but you might be calling it think it’s an actually well crafted public api. The only reason I’d think they return JavaScript on an error is because they run it on their frontend to show an error message? Anyway sorry to hear about that bug. Sucks no one reached out sooner
I hope this video blows up and gets you a nice influx in your newsletter, you're content is great!
You’re brave for putting this out there, respect. This makes me more zealous about TDD
I worked for a Unicorn. Their Saas backend endpoints broke all possible restful api best practices you can think of. The validation error is a property of the response wth a response status of 200 instead of 404. As their API is not public the bad code is still there ... offshore coders
I see so many situations where web developers just willy nilly expect a payload to be json. You have to check the content type in the header before doing this, especially if you don't control the API. This is why standards exist
Thank you for sharing this for others to learn. With Astro, does it generate Client or server code? Can you add logging and monitoring too?
3:10 Yeah, linter couldn't catch the error because it sees the last closing bracket as a mere string character.
Finaly statement block is being executed always: only try or try+catch. So, why there's the error setup?
You shoulve tried switching it off and back in again, works wonders. Loool . Thanks for the teaching moment and will subscribe
It hurts to see the bug/issue being so costly and non-trivial to fix. I hope you'll find a long-term solution for custom subscriptions for your email provider.
Tip: One other habit that will save you from tricky future bugs is to treat all responses < 300 and >= 200 as a potential success. Some services will respond to a successful POST with 201 Created, for example.
I've had to build backend Stripe and PayPal API endpoints but my computer burst into flames and I woke up 2 weeks later in a North Korean ditch.
I had subscribed this way, gonna subscribe again! :D Thanks for putting this out in public!
Admire the accountability and professionality... props.
If you had a dashboard tracking metrics, you would/should have seen a decline, which would have caused you to look to see why your sub counts dropped.
Thanks for sharing. It was nice to see a real costly mistake and how you debugged/fixed it. The fact that you don't have any testing around that is crazy. I do QA for a living. Hit me up. I'd be glad to help build some regression tests for you.
@uscjake868