Tuesday, February 8, 2005

Pheeewwwww! Back to my old application maintenance

 Originally posted on: http://geekswithblogs.net/meshel/archive/2005/02/08/22351.aspx

Didn't write here for the longest time, I hope I can write about what I've been doing for the last month or so soon (once the contract is signed, probably or maybe never :-()

However today I'm kind of over that, since I delivered my last build and barring all kinds of bugs that might be returning my way from testing, I'm done, or am I?

Decided to tackle a bug that was assigned to me some time ago with hopes that I could find time to look at it, so I did. The bug describes a situation when a configuration option in the application is set so that middle names of users are displayed all around the site (this is a web site application, but not located at a single point, i.e. not an ebay but sharepoint).

The bug described a situation where long first middle and last names were used, that was my first clue. The other clue was the error returned by the application - 3421, at first I thought this was an Internal code, but quickly decided against it, since a quick search on code (well not that quick) revealed, that at no point this number is event used (just to clarify, searched code includes ASP files, VB files, and even the DB source code Table and SP scripts). So I decided that this is probably some windows/external component error. Quick search on google gave me the following reply - “3421 - Application uses a value of the wrong type for the current operation. “

This data combined the two bugs together, this looked like I was probably sending a too long string into some function that interacts with the DB.

Running through the re-construction/production of the bug, pointed me finally to a specific function storing the User data in one of the database tables, still even though the data sent was long, it wasn't too long. The data described by the tester, was less than 40 chars per field which is what it should be, so why the error?

And there was my answer, the display parameter for middle name, is an addon to the original application, before that Middle name was stored as part of the user details, but never displayed at all anywhere else besides user management. At one point in the life of the product, someone decided (or some client demanded) that it be displayed, and the long work begun. Finding each and every place that first name and last name is displayed and making sure that if so required middle name be displayed along with it.

Now this was done as it should be, except in one place, there is one client application that works with our web site application (actually more than one, but never mind) this application receives from the web site the user data. And one of the requirements was that it too would display the middle name. However, at this point apparently no dev power was to be wasted, so it was decided that no modifications will be done on the client side, but instead, when giving the information over to the client, the web site will combine the First name and the middle name and send them both as first name (the client handles this somehow by trimming off the extra chars it cant display in the length allowed).

However at some remote point in the system, in some obscure table, that holds data, with some function that insert this, this effect was missed, and when storing the data to be sent to the client, it was stored as FName+MName instead of splitting it, and was given the limit of the First Name only (40 characters) so that when a slightly longer than normal name+middle name was sent - it failed...

One more bug off the list (I don't know maybe 1500 to go????)

BTW I forgot to mention, the error wasn't there originally, however at some point an additional feature was added that forced the application to keep track of certain activities (hence the new table)...

I know this sounds like a rant, and indeed it is. But there is a lesson. Sometimes the quickest solution isn't the cheapest :-)

No comments: