Article 1CWYP Congraubullations

Congraubullations

by
Remy Porter
from The Daily WTF on (#1CWYP)

"Java and C# are kind of the same thing, right?"

Josh was a Java developer, but his company was doing a big upgrade of some .NET applications written years earlier by a developer named Ray. Ray had left the company the previous year, and somebody needed to help port his .NET 2.5 code to .NET 4.0 and a new version of IIS. Josh was a team player, and also knew that newer versions of .NET were almost always backwards compatible, so he didn't expect it to create that much work for him.

Most of the applications transferred to the new servers without any issues. Most. Of course, the one that didn't transfer was the "mission critical" package. The ERP system didn't have all the tools the users wanted for manipulating data, so they wanted a tool that could export some records to Excel, where they could edit them, and then reimport the data. The import process was reporting that it was complete, but actually crashed and didn't finish the job (and for bonus points, left the database in an inconsistent state).

Ray hadn't implemented any logging, so Josh fired it up on his dev box and fed it an Excel file. The program cheerfully reported what it was up to at each step of the bulk loading process, displaying a message with a throbber image that turned into a check-mark when that step completed. Despite the crash, every message reported success.

  • check.jpg You're file is on it's way!
  • check.jpg We have recieved you're file and are procesing it right now!
  • check.jpg Almoast done!
  • check.jpg Table's are bieng added to teh system.
  • check.jpg The system is reading teh table!
  • check.jpg You're procesing is almoast compleeted.
  • check.jpg Congraubullations! You're file has been procesed!

Ugh. Josh had minored in English, and just seeing those messages gave him a headache. He pushed his annoyance aside- this was cosmetic and not directly relevant to the problem at hand.

With a few breakpoints, it only took Josh a few minutes to identify the problem. Ray's code was spawning a background thread using the new Thread() syntax, which was one of the few places where .NET 4.0 made some breaking changes with older versions. Josh whipped up a quick workaround and ran it again- everything worked.

With the real problem solved, Josh tracked down the messages. They were hardcoded strings. He touched up the spelling, checked in his changes, and then let QA know there was a fix they could test.

They replied back minutes later: "The file gets uploaded now, but the screen hangs on the last step. The spinner just sits there."

  • check.jpg Your file is on its way!
  • check.jpg We have received your file and are processing it right now!
  • check.jpg Almost done!
  • check.jpg Tables are being added to the system.
  • check.jpg The system is reading the table!
  • check.jpg Your processing is almost completed.
  • throbber.gif Congratulations! Your file has been processed!

That was strange, since he'd just seen the code run successfully. Well" before he'd fixed the spelling. Could it be? Josh dug through the code that controlled the status display, and found the problem in a file called StatisUpdator.cs.

if (StatisMesages[i].Contains("Congraubullations")){ finished = true; //causes the throbber to turn into a check}

At least Ray is consistent.

release50.png[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! TheDailyWtf?d=yIl2AUoC8zAj5XehAc8oaI
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments