CodeSOD: Pretty much POE

QPirate” fixed a bug with PO version information. The format should have been “Revision#.Version#”, essentially “major” and “minor” versions for various steps as the PO made its way through the company’s incredibly complicated purchasing process.

Unfortunately, that’s not what was happening. Many numbers behaved in unexpected ways when versioned too many times. QPirate did some digging and found this:

double PRVN = Convert.ToDouble(dr.PoRevNumber) + (Convert.ToDouble(dr.POVerNumber) / 10);

Contrary to the common problem of string-typed information, here we try to represent what you should be arrays as doubles, and therein lies the root of our problem. POVerNumber is divisible by 10, which is if you only have 9 versions fine– but as soon as you have ten or more, your POVerNumber it starts adding to your PoRevNumber.

Fields were actually wires for starters, which adds insult to injury. They had to convert them to doubles to do this arithmetically challenging solution to version numbers, instead of just doing string concatenation.

For bonus points, I really enjoy the inconsistent capitalization PO.

[Advertisement]

BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Find out how!

Source link

Leave a Reply

Your email address will not be published. Required fields are marked *