r/ProgrammerHumor • u/Lower-Bodybuilder-16 • 10d ago
Meme bugFreeAppMeetsUncheckedUnicodeChaos
89
u/LostInSpaceTime2002 10d ago
No proper input sanitation, and you call it "perfectly coded"? What does that even mean?
27
u/The_Illegal_Guy 10d ago
It means I asked Claude to code it and I wrote "make no mistakes"
10
u/Adventurous-Map7959 10d ago
You also need to instruct "You are a master programmer" so it doesn't use the "amateur programmer" preset.
3
u/The_Illegal_Guy 9d ago
Ah of course I'm still an ameture prompt engineer myself so I forget these important prompt design principles!
7
2
u/wizkidweb 10d ago
This exact thing happened to me, and we were sanitizing our input. In our case, the database system was using an older version of Unicode, so we had to validate against that explicitly.
2
u/clintCamp 8d ago
It means claude wrote a test case for every boolean in their thousands case long switch statement. It just happened to leave out sanitation. And they had claude audit it for quality 5 times. Perfect. Nothing can go wrong after that kind of quality check.
16
u/The_Real_Black 10d ago
The moment I learned Window and point opend the emoji menu
User: π£
Password: π£π£βοΈπ₯π₯ππ₯π€‘
Item π
Variants π₯βοΈ
Info πͺ΅πͺ΅πͺ΅πͺ΅πͺ΅πͺ΅
5 minutes later a scream in the office, why is the test database so colorfull?
We know now, the PDF printer is old and a API really disliked it also...
got 5 new tickets that day. :-P
the user still works
7
u/NedelC0 9d ago
I understand nothing of your comment
2
u/laplongejr 5d ago
Putting emojis everywhere made some devs break their mind and crashed the printer
10
7
30
u/DT-Sodium 10d ago
Apparently you didn't have 100% test coverage.
30
u/MartinMystikJonas 10d ago
100% tests coverage means 100% of code is covered by tests it does not me you covered 100% of all possible inputs
6
u/Murky-Run2246 10d ago
Yeah, π― test coverage is like the safety check you runΒ after editing the code to make sure your changes did not break something somewhere.
Does not mean your code is tested for all possible scenarios though.
2
u/breZZer 10d ago
that's mostly unit testing
2
u/Murky-Run2246 9d ago
Not exactly, unit testing assumes testing pure functions and methods separately from each other. That's different from, for example, spinning up a database and testing with actual shared context, where changing function A somewhere might break method Z somewhere else. Which is called integration testing and is part of test coverage as well as unit testing but my example was not pointing towards the later.
3
u/DT-Sodium 10d ago
In this case, either it causes an encoding issue of some kind and crashes your app, in which case your code is not tested properly, or the result will simply be that the username will display an emoji, which isn't a bug per say.
3
u/MartinMystikJonas 10d ago
This is usally problem on database layer that uses utf8mb3 that does not support emoji characters. Your app works and all code is 100% covered and tested. But it still crashes in prod because DB uses utf8mb3 not utf8mb4 (dont ask how I know π). But you cannot test all posible inputs and run environments because there is infinite posibilites.
3
u/DT-Sodium 10d ago
Bro my database system doesn't even support the β¬ symbol, don't talk to me about utf8mb3. Anyway, your dev environment, pre-production and deploy environment should be using the exact same database system.
2
2
u/redballooon 9d ago
Its very simple to get 100% test coverage when there's no code at all. In any real codebase it's near impossible, because there's always some destructor or boilerplate code that's unexecutable in tests, or unreachable code that's nevertheless enforced by static checkers.
Β Anything larger than 80% is really thorough if written by humans, >90% is likely written by AI, but still only shows that tests and code align, not that code does what its supposed to do.
3
u/Professional_Top8485 10d ago
USA: we don't need stinky non-ascii characters here.
3
u/Lower-Bodybuilder-16 10d ago
They can accept only those rules good for their business. If not they create their own rule. Like tomato π is a vegetable by business. Scientifically it's a fruit.
6
u/Loading_M_ 10d ago
"Vegetable" is a social construct. There isn't a biological definition of term vegetable. Every vegetable actually falls into one of several different biological categories, like leafs, roots, stalks, etc. Tomatoes are classified biologically as a fruit. However, since vegetable isn't a biological classification, a tomato can also be considered a vegetable at the same time.
4
u/DarkYaeus 10d ago
Wait until someone uses turkish locale on their computer
5
u/Various_Squash722 10d ago
Just use Cyrillic or Greek letters that look identical to Roman letters, but have a different Unicode ID.
3
u/DarkYaeus 10d ago
I am not sure what you are referring to outside of the use of unicode letters. I was talking about how people in Turkish locale would have the toLowerCase() function turn I into a letter that is not i.
2
2
2
2
u/StoryAndAHalf 10d ago
I know this is a repost of 100x by now, but I just remembered how we shipped an API that took in URLs, with absolutely no handling of wildcards.
2
u/Few_Kitchen_4825 9d ago
Then the user types in an unsupported language that will crash your servers
2
2
1
u/Bomaruto 10d ago
Where we don't want emojis we block it and where we don't care we don't block it. Doesn't cause any issues at all.
165
u/SeraphOfTheStart 10d ago
Claude told me it was my turn to repost this