Monday 3 September 2007

Today was another learning experience. We in all are three developers usually working on the same files, repeatedly checking in and out of the source safe, but then at times, we all tend to save the files at the same time. this occurred when we accidentally commented out the email addresses, that a particular form need to be sent.

Now as things happen, we only realised it when we had an issue raised that people are not receiving confirmation email after submitting the forms. Lesson learnt!

Now we have devised two different methods, to bypass this bug. we are having all the email addresses in the web.config file, so no more accidental messing with the addresses in database or code file. we also are checking if the form is on live server, so as to prevent commenting out the send code, in order to prevent annoyed managers with inbox full of test emails.

The second method is to use the preprocessor directives, which will be disabled at the developer server. till today i haven't actually felt the need to use the preprocessor directives (Except from C++ classes in my uni; which was to score higher!). the only drawback for this system, is to remember when to turn off the declaration, and check it back in. this is the only reason we went for the first solution.

we have two different servers for live and development, and hence check the URL or IP address for the server. if the server isn't live, then don't send the mails. Also we have the preprocessor directives in place, so whenever we want to test the live server pages, just edit the directives, and prevent the emails being sent.

Simple solutions, but never thought of it that way!

No comments: