5 ms·
Do you work in software development? I have, on multiple occasions, introduced bugs that are orders of magnitude wackier than this.
by axg11 5y ago
Do you work in software development? I have, on multiple occasions, introduced bugs that are orders of magnitude wackier than this.
- phkahler 5y ago>> Do you work in software development? Yes I do. >> I have, on multiple occasions, introduced bugs that are orders of magnitude wackier than this. Those would make a nice blog post. I've done some stupid things and seen some unexpected results, but I've never encountered the likes of this "accidentally" incrementing price thing. ;-)
- dahfizz 5y agoIt could be an index error or a misuse of references, where product B is supposes to be product A + 10. It could be that some local taxes or fees comes out to $10, and the client code does `price += taxes` on page load. There could be code to round up to a $10 increment, and then subtract 2 cents so the prices are all $X9.98, but the rounding logic is incorrect. Since this is JS, they will be using floating point prices. That is a minefield in itself. I'm not saying it's definitely a bug. But it trivially could be.
- willcipriano 5y agoWhy do you need to keep state here? I can see calculating the prices dynamicly, but why save and the reuse the result?
- MiddleEndian 5y agoThey could be using some node.js framework they don't understand that is silently persisting data.
- dntrkv 5y agoEspecially if they are using isomorphic JS. Globals / singletons are very dangerous when the JS runs on both the server and client.
- jonny_eh 5y agoCaching.
- IanCal 5y ago* Pull data from API for pricing, later add caching * Modify value to give local amount, not realising it's modifying a cached value * Never test refreshing doesn't change the price
- sosuke 5y agoVerification would be this same test but seeing if the price persists into the "cart" or further down the checkout / shopping process.
- phkahler 5y ago>> It could be an index error or a misuse of references, where product B is supposes to be product A + 10. But why would ANY price be determined in part by the users browser. It gets it right the first time, so why would page reload do anything different? This makes no sense.
- lupire 5y agoIt makes no sense, because it's a bug. Why would one package double in price, but the others not change? > gets it right the first time, Maybe, you don't know. It may be adding $10 the first time too.
- powerslacker 5y agoAccidentally the price thing is really easy to do.
- worker_person 5y agoIt's really fun writing bug that affects motors. Okay slowly turning the 800 pound steel beam 1 degree per minute, and now it's trying to toss it across the room... Boss we need a new $1,000 dollar motor!, and maybe a new wall.