Friday, 4 May 2007

Bug: Trend error when clearing first weight in first log (JavaScript live update)

If a user entered a weight entry on a monthly log in which there was no trend-carry forward (i.e. the first log in the database), which thus defined the trend as starting with the first weight entered, then entered subsequent weights, and finally went back and deleted the first weight in the log, the trend was not redefined as starting with what has then become the first weight in the log. This problem refers exclusively to the JavaScript live update code---once the log was saved in the database, the trend would be computed and displayed correctly. I modified the trend re-propagation code in the {\tt changeWeight} function to ``propagate'' a blank trend downward until the first nonblank weight is encountered, then define the trend as starting at that value. (Reported by Robert Ewing.)

No comments: