ProgrammerHumor

yepThatsMe

yepThatsMe
https://i.redd.it/t16gqvuc4lcf1.png
Reddit

Discussion

No-Article-Particle

What are you doing indeed...

1 week ago
Ronin-s_Spirit
:js:

r/programmerhorror you mean.

1 week ago
adiXjinx OP

ohhh sorry i uploded it at wrong place

1 week ago
Boris-Lip

Next compiler/framework/<insert whatever throws this shit here> update they change the message and this thing breaks. But you already know that, yet still doing it...

1 week ago
adiXjinx OP

i seriously don't know what to do, like what can i do ?

1 week ago
Boris-Lip

Is it a separate exception type? Catch a specific type then. Is there an error code instead of a message? Check against that error code. Etc.

1 week ago
adiXjinx OP

waait!! wtf am i doing, username can't be updatable why tf i build that ahhh this whole time šŸ˜­ļø

1 week ago
gorilla60rilla

lol this put a smile on my face, no hard feeling tho, just fun, I see myself in you. We should talk more with our duck bro

1 week ago
adiXjinx OP

i don't have duck !!

1 week ago
reginakinhi

That's the problem right there

1 week ago
[deleted]

[deleted]

1 week ago
Cyberuben

This would still have the possibility of race conditions, where you check, it’s available, another transaction commits, and now it’s not valid. Handling the unique constraint error the same as the pre-check should cover enough

1 week ago
gameplayer55055

I usually do select 1 from tblUsers where username = @name

It still may not be the best method, so I rate limited auth just in case cool haxor decides to rape my db

If you're scared of race conditions, make an SP with a transaction for auth.

1 week ago
luckor
:redditgold::redditgold::redditgold::redditgold:

Don’t forget to add ā€œFOR UDATEā€ or similar, otherwise a normal transaction won’t prevent race conditions.

1 week ago
AdvancedSandwiches

Yes, but important to note this will only do anything if you're inside a BEGIN / COMMIT.

BEGIN / SELECT FOR UPDATE / INSERT / COMMIT, you're golden.

1 week ago
om_nama_shiva_31

Worst bait ever

1 week ago
rover_G
:c::rust::ts::py::r::spring:

Surely the error has a type and/or code that specifies the exact issue? Or maybe you can check the database for duplicate usernames?

1 week ago
ZeroDayCipher

Idk wtf is going on here but dam I want to at least throw the error check into its own variable so your if statement isn’t staggered across multiple lines. My god….

1 week ago
East_Zookeepergame25
:ts:

I had drizzle flashbacks

1 week ago
gmzlov

Whats that 😭

1 week ago
Atduyar

Maybe this could help RFC-7807.

1 week ago
adiXjinx OP

CodeRabbit

Fix typo in filename: "createResponce.ts" should be "createResponse.ts".

yess sure why not change every fuking file for a "s" ??

1 week ago
kimochiiii_

don't you have some IDE that'll do it for you?

1 week ago
adiXjinx OP

yeh i did it

1 week ago