Live data from Hacker News

A ChatGPT mistake cost us $10k

asim.bearblog.dev

521–526 of 526 posts

Re: A ChatGPT mistake cost us $10k

#521

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.

You’re right… I was remembering it as a `server_default` attribute. Those were quoted in the other lines, but this wouldn’t have been.

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.

I tried subway online ordering once almost a year ago. The last final screen crashed and deleted the entire order from my cart. Anyways, you're probably wondering if the order actually went through but subway's UI was shit and nearly tricked me into replacing the same order a second time: yes.

Re: A ChatGPT mistake cost us $10k

#523
post #268
post #8

Earlier 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.

But why should we assume twice is enough...

Re: A ChatGPT mistake cost us $10k

#524

Earlier 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.

That's what I said. Parent said

> There's value in having your backtrace surfaced to end users

Re: A ChatGPT mistake cost us $10k

#525
post #178

Earlier 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.

You don't even have to reject/forbid them, just make their use explicit.

Re: A ChatGPT mistake cost us $10k

#526

The 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. > >…

[dead]
Post reply on HN