Date Bug!

June 25, 2008

I’ve been taking some time to clear up any bugs I have found in the UI part of the application.  So far most have been insignificant issues…like a label slightly off, or a font incorrectly sized.

However, a user recently reported a nasty bug I had no idea existed.  What happened was that no matter what number of days was selected for the license to be valid, it always ended up being 30 days.  So choosing a key to be valid for 1 day, caused a license key to be created for 30 days!  It looked like the application was adding 1 MONTH instead of 1 day.

My initial thought was that I had somehow botched the way that international dates were handled in my code.  In the US we list dates as MM/DD/YYYY, but in Europe and other countries it is handled as DD/MM/YYYY by default.

I recall being very careful about date handling when creating the API – it’s a cornerstone of the application, so I was really worried when this issue was reported to me.

I went through the date handling code in the API, and sure enough it looked to be done just right – no chance of any issues.  I verified this by running my unit tests, and by manually setting my PC to different timezones and regions.  I could not reproduce the problem.  However, this kind user sent me screenshots as proof, so I knew there was a real problem, and not some misunderstanding.

Then it occurred to me that I was testing this all in a *Registered* version of my UI and API.  Sure enough, when I switched to a DEMO version, I was able to reproduce the bug.  All License Keys generated were created for 30 days, no matter the UI “days valid” selection.

After this insight I very quickly found the offending code.  At some point in the recent past, I moved some code around that deals with the DEMO version of the application.  In DEMO mode, you cannot create unlimited keys, or keys that last more than 14 days.  In a previous iteration that limitation was 30 days.  By moving the code around, I inadvertently hard-coded the date range to be 30 days while in DEMO mode.

Very bad.  I apologize to all my potential users who were confused or frustrated by this.

I have fixed this bug, and released an updated install to my website.


Video Demonstrations

June 8, 2008

I created two video demonstrations on how to use Serial Key Maker.  They are located on my website, and I uploaded them to YouTube:

 

and

They are also available from my website: http://www.serialkeymaker.com/