OnSwipe redirect code

Thursday, October 25, 2007

First check-in of my code into Mozilla codebase

This was a long awaited post, not by the readers waiting to read this but by me, the author, waiting to write this. This is by far the most important blog post written by me, not for its content but for the moment it describes.
In a previous post titled "My GSoC 2007 Story" I wrote about how excited I was about this association with Mozilla and about the opportunity to fulfill my long lasting dream of contributing to open source and having credit for some notable software development. But that just the beginning of the fulfillment of the big dream. The way was just shown to me and I was given the map just having the end points of the journey. It was up to me to figure out the way and reach the destination after crossing all the hurdles. I am now proud that I could stand the journey and complete it. This post is the proof and the reward together.

The journey was of course not smooth as described in my "First Mozilla journey" post. But it was worth it. Now about the day I achieved it. It was 5th Sep 2007, yes Teacher's day here in India. (I guess I should really be thanking my teachers for their teachings as well as blessings). That was when Shawn(sdwilsh) checked in my patch, of course with certain changes to it from him. Here is the check-in comment.

The end was more tiring and hectic than I initially assumed. My feature was initially targeted for M7, but then due to delay from my side it was re-targeted to M8. Since this was considerably big thing and involved quite a bit of risk the drivers decided that this feature would be in only if it can come in by M8. Things were going pretty well with me working till 10 or 10:30 at the office due to lack of internet connection at home. I used to get a new patch every alternate day or at least hit a dead-end and wait for help from biesi/dmose/sdwilsh or some other person. I ended up adding more stuff to nsDownloadManager class than I thought I would be doing. Every week more than 2 or 3 times I used to discard some done stuff and redo it in different way. This was mainly because of my lack of XPCOM knowledge. Though I was very determined to get it in FF3 it was getting heavier and heavier for me. Thank God, I finally submitted a patch which addressed all the issues mentioned in the comments earlier.

It was all working and just a few hours (that was 10:30pm here and I had to go home - by bus) before the tree was to close for M8 I figured out that nsIFile.GetSize() was not returning the proper value because of which downlaods were getting corrupted and were of sizes more than the source files. The solution turned out that I had to clone the file to avoid the cached values. This required some effort and I postponed it to next day morning hoping to get it done before the tree closed. Though dmose told me to do it right away so that a review can be done that day itself and the patch would go in. But it was too late for me and I just left the office against all my wishes to stay overnight and work with those guys struggling in US. All the way to home I was cursing myself as I was not confident of getting it done in couple of hours and hence I might lead to this feature being dropped from FF3. That would have been like a big blow to me as I had widely publicized this among many of my friends.

The scene on the other end was also pretty similar. sdwilsh and Mardak spent almost the whole debugging my patch and figuring out what was happening. dmose had mentioned earlier itself that the management wanted this feature though it was not in the FF3 PRD. Lots of people had already blogged about this feature in FF3 and hence it was very critical. They finally figured out that the "http referrer" was also needed for resume to work properly and they added that also to the DB and sdwilsh came up with a new patch and probably got it reviewed by Mano.

When I came back in the morning the new patch was ready and the whole of mozilla team worldwide was active as lots of check-ins were to be done before midnight. sdwilsh finally got mconnor to review the patch. Since it was patch which was r+ by sdwilsh, mconnor could not find any flaw except for a comment about the file cloning to be made more clear. It was finally made and sdwilsh told me that he would be checking in that patch. I was very much excited and I had every right to be. After 3 months of work, several night outs discussing stuff with my US counterparts and much other effort had gone into bringing out the code in that patch. And finally when sdwilsh put the cvs check-in output on the bug I was so relieved. I knew that it would take an hour atleast for the new code to be picked up by mxr. After an hour I visited mxr to see my name in the contributors list. I copied the link to the line with my name in the nsDownloadManager.cpp and put it as my status message in GMail chat and Gtalk.

It was a great learning experience for me and a much greater sense of achievement.
Thanks again, Google and Mozilla.

I now continue to be a part of this awesome community and contribute whenever I can. After this success I took up the job of providing resume support for "Open With" kind of downloads. More about that in another post.

Shree Yalaguresh Prasanna.
Hari Om.

No comments:

Post a Comment