esitarski / CrossMgr

Cyclo Cross Management Application
MIT License
40 stars 20 forks source link

fixBigFloat() edge case breaks index.html category summary generation #122

Closed kimble4 closed 1 year ago

kimble4 commented 1 year ago

index.html sometimes doesn't include a category summary for race. This is due to a JSON parse error reading the payload, where a value has no characters after the decimal point.

This happens when fixBigFloat() processes a float where the first 5 decimal places are zero. The rstrip('0') then removes the entire decimal part, leaving a string such as "24.," which the javascript seems happy with but json.loads() chokes on in ParseHtmlPayload.py. The index entry is then generated without any payload data, so appears without a category summary and in the wrong order.

https://github.com/kimble4/CrossMgr/commit/2cc3b01327b75cc78f8017d9a70d6cafb4e5e27d fixes it for me.