Earlier quoted context omitted.
This is an error that should probably have been caught just based upon the color of the text when it was typed/pasted into the source code. Of the uuid() call was in quotes, it would have appeared as text. When you’re blindly using so much copy/pasted code (regardless of the source), it’s really easy to miss errors like this. But our existing tools are already built to help us avoid this. Back in the day, I used a to…
> This is an error that should probably have been caught just based upon the color of the text when it was typed/pasted into the source code. Of the uuid() call was in quotes, it would have appeared as text. It's not in quotes. It's a function call. The issue is that the function call happens once, when you define the class, rather than happening each time you instantiate the class.
A ChatGPT mistake cost us $10k
521–526 of 526 posts
Re: A ChatGPT mistake cost us $10k
#522"Note: I want to preface this by saying yes the practices here are bad and could have been avoided. This was from a different time under large time constraints. Please read with that in mind" These "constraints" are why I'm terrified of subscribing to software
Having worked with some legacy subscription code it can be quite nasty. We had race conditions where we would charge users twice This has made me paranoid that any time I see timeout or error related to money I assume it went through and come back later.
Re: A ChatGPT mistake cost us $10k
#523Earlier quoted context omitted.
Honestly I'm not sure why ChatGPT has anything to do with this problem. I remember making the exact same mistake (accidentally using a single function call in a schema) back in 2010. No LLMs required. The bigger culprit is probably a lack of testing / debugging. This error would immediately get caught if you simply registered twice on a test instance.
> This error would immediately get caught if you simply registered twice on a test instance Friendly reminder: check if your codebase is actually testing this! One of the interesting consequence of running unit tests with a fresh database everytime is that problems related to unique constraints seldom get caught by unit tests.
Re: A ChatGPT mistake cost us $10k
#524Earlier quoted context omitted.
I don't think showing stack traces to users is good practice? Every time one of my users gets a didn't work message I log the stack trace instead.
Why would you show them a stack trace? This should be logged.
> There's value in having your backtrace surfaced to end users
Re: A ChatGPT mistake cost us $10k
#525Earlier quoted context omitted.
But this isn't an `any -> any` case. They passed in a default value, as a string, which is the correct type for a default value for this column. Even with very strong typing they wouldn't have got a type error here right?
You could make a special primary key column creation function that rejects static values.
Re: A ChatGPT mistake cost us $10k
#526The blog post is 404ing, here's a Web archive link https://web.archive.org/web/20240610032818/https://asim.bear... The author has added an important edit: > I want to preface this by saying yes the practices here are very bad and embarrassing (and we've since added robust unit/integration tests and alerting/logging), could/should have been avoided, were human errors beyond anything, and very obvious in hindsight. > >…