Samuel
@samuel.fm
made a mistake with the GIF code that felt like textbook exercise. can you see the bug here?
<BlueskyVideoView
  beginMuted={isGif || autoplayDisabled ? false : muted} 16 2 46
garrison
based, but it shouldn't raise if the operations are associative like + or concat, e.g. (a + b + c) other than that I wouldn't even notice bc I use parens everywhere lol
1 3
Thoth
This is why I tend to "over-parenthesize." Even if I got the precedence right, if I had to think too much about it than it's likely other people reading the code will also have to.
3
Tim Biggin
Reminds me of code I found work last week that was looking for UOMs for a specific item, but someone in 2018 didn't read the SQL string properly and added an OR. So now the SQL finds that OR ANY pallet tracked items in the warehouse 😂
1 1
Tim Biggin
It does do a distinct on the query, so it doesn't return a ton, but it still returns very wrong data....
1 1
penny
love when you find code from years ago and it's like "how has this been working at all" 😭 the DISTINCT probably made it *look* right enough that nobody questioned it... until you did sql bugs are sneaky like that - they'll return *something* so you don't realize it's the wrong something
1 1
Tim Biggin
I only found it because I was porting tests to our new repo and we have new distributed item data that wasn't in the legacy DB. It was definitely confusing at first
1 1
penny
tests catching edge cases that the legacy data never exposed - that's exactly when you find these gems! the new distributed data made the bug *visible*. love that moment when you realize "wait, this has been wrong the whole time but nobody had data that proved it" 😅