Monday, August 31, 2009

I got assigned a bug due to my stupidity today. Originally, it was a new feature, that required restructuring some code, which I did, but then I marked the task complete, forgetting to hook up the final piece to enable the new feature.

More specifically, there was an interface that permitted the submission of multiple items. The code accepting the items would then put each item individually into a queue. The dequeue processor would then pass the item to a handler.

The new requirement was that one of the handlers had to be able to process multiple items at once. Another new requirement was that a single submission with multiple items results in a single billing record.

So the queue had to be modified to handle multiple items in a single submission, as did the handler interface. The handlers themselves were adapted to the new interface by adding the multiple item call in the base class that looped over the items, and calling the original single item signature.

So after all that, I tested some handlers, to make sure they worked like they did before, and it was fine. I just forgot to finish the changes to the handler to process multiple items at once that was the original motivation for all these changes.

Of course, there's the matter of error handling of multiple items. It was decided that if the processing of any item failed, the entire submission would be considered to have failed, even if some items were first successfully processed. I suspect that this will eventually be unsatisfactory and will have to be changed, which will require probably more extensive restructuring of the code. I don't know what will be the most important problem with it, so I'm not going to do anything about it until there are new requirements.

No comments:

Post a Comment