CodeSOD: Tri-State Boolean
"Lindsay."
Lindsay did her best to ignore her co-worker, Asher. Ever since management had removed cubicle walls (to "facilitate communication"), it had been a never-ending trial focusing on fixing bugs with the world's most annoying webdev prodding her every few minutes to talk about some inane television reference or sports event.
"Lindsay."
Lindsay closed her eyes, picturing the Maui beaches where she hoped to be reclining in two days time. Surely she could hold out that long, right?
"Lindsay!"
"What?!" She snapped, ripping off her headphones to look at his screen.
"Did you see that P1?"
Stunned that Asher was actually bothering her about, wonder of all wonders, work, Lindsay closed her travel agent's website and pulled up the bug tracker.
Sure enough, she'd been assigned a P1 defect. In the self-service component of the Procurement website, all users were able to download a spreadsheet containing the price lists for...
Lindsay gave a low whistle. "Is that every client's price sheet?"
Asher nodded, face grim. Pricing was a strictly held secret in the business-to-business world; if one client found out another was getting a deal they didn't qualify for, there'd be hell to pay. Only admins should've had download privileges, but somehow, that download button was enabled for every user of the site.
Priority one was usually reserved for "the entire site is down." A price sheet leak was pretty much the one exception.
It was easy enough for Lindsay to pull up and duplicate. She wondered how long the button had been incorrectly enabled. There was no indication in the ticket. Lindsay called the user, who explained they'd just noticed the problem. "But who knows how long it's been that way?"
Crap. It wasn't just a simple matter of reviewing what had changed since the last build. Lindsay pulled her headphones back on, switching from relaxing white-noise to something more upbeat while she brought up the debugger. Three grueling hours later, she found the reason why any and every user was able to download the price sheet:
if(userCanDownload != true && file != null || userCanDownload != false){EnableDownloadButton();}Else{DisableDownloadButton();}
"Huh," she said, tilting her head slightly to the side as she puzzled over the inanity.
"What?" asked Asher, coming up behind her.
"You know... somehow I expected FILE_NOT_FOUND."
[Advertisement] Release!is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!