Repository navigation
fix: harden parsers, pagination, and HTTP - #19
Conversation
[High impact] Pagination, HTTP bounds, and parser hardening across the SDK. The PR appears safe to merge, with a non-blocking numeric parsing fix recommended. Findings
|
| if (text.starts_with('+')) { | ||
| text.remove_prefix(1); |
There was a problem hiding this comment.
Double signs become valid numbers
DataPoint::get_double removes a leading + before calling std::from_chars, so malformed text such as +-1.2 becomes a valid -1.2. The climate reader in src/models/climate_index.cpp does the same. Both readers can return a believable negative measurement instead of rejecting the cell. After removing +, reject another sign and add regression cases for both readers.
Fix complete JSON reads, one-based CDO pagination, date/range validation, CSV and climate parsing, cache rollback, metadata field mapping, and retry quota accounting. Bound libcurl responses and callbacks, preserve parent compiler flags and custom hooks, and add portable HTTP and installed/FetchContent consumer regressions. Prepare v0.4.0 with CMake 3.31, libcurl 7.85+, and Glaze 9.
Validation: 199 native and 199 ASan/UBSan CTest entries, formatting/type audit, Markdown, hook cases, offline benchmark, installed/FetchContent consumers and both README examples passed. Live Access Service CSV/JSON data agreed and dataset metadata returned its field list. Authenticated CDO calls were not run without a token.