Skip to content

fix(api): read an ArcGIS error code 503 as RateLimited - #31

Merged
Reddimus merged 1 commit into
mainfrom
fix/review-followups
Sep 25, 2026
Merged

Reddimus merged 1 commit into
mainfrom
fix/review-followups

Conversation

@Reddimus

Copy link
Copy Markdown
Owner

Summary

These come from a review of 314664f..v0.4.2: four reviewers, each finding checked by an adversarial verifier, plus an independent Gemini pass. The v0.4.2 code held up. Fuzzing about 290k inputs under ASan showed no out-of-bounds reads, and parse_owned_root and parse_root built identical trees. Five small issues survived:

  • Bug. Error::from_arcgis mapped an in-body {"error":{"code":503}} to ServerError. An HTTP 503 is RateLimited, and the README and error.hpp say 503 is RateLimited. It now maps the same way. A new test covers 503 and 500.
  • Test gap. Nothing checked the text query_layer returns. A verifier released each body before on_page ran, so every page came back empty, and all 131 tests still passed. The paging test now compares each page byte for byte.
  • tools/verify_fixture_checksums.py failed on a Finder .DS_Store in tests/fixtures, and the SHA256SUMS recipe can't fix that because ls skips dotfiles. It now skips dotfiles like test_golden.cpp does.
  • The paged_into comment said peak memory is "one page's tree plus the result". The body is alive while its tree is built, so the claim was wrong, and the comment now drops it.
  • The 0.4.2 CHANGELOG said the old stream parser rejected inf and nan. libc++ 18's stream accepts both, because __stage2_float_loop searches all 32 atoms. The claim is gone, and I'll update the published v0.4.2 notes to match after merge.

Rejected after checking:

  • Gemini's "nullptr + 0 is undefined behavior". C++ defines it: [expr.add]/4.
  • Gemini's "embedded NUL makes clients and parsers disagree". Tested through the public API: both accept the same bodies and reject the same truncations.
  • Gemini's "Makefile NPROC/CMAKE aren't portable". Both are defined at the top, with a sysctl fallback.
  • "parse_ is 4-7% slower".* Instructions rose, but CPU time over 7 repetitions stayed within noise.

Testing

  • The new 503 test failed before the fix (ServerError vs RateLimited) and passes after it.
  • make test (131/131), make lint, make lint-md, make fixtures-check (also with a .DS_Store present), and make test-consumers pass on macOS.

Error::from_arcgis sent every in-body 5xx to ServerError, so an ArcGIS
{"error":{"code":503}} disagreed with an HTTP 503, which is RateLimited,
and with the README and error.hpp. It now maps 503 the same way.

Follow-ups from a review of 314664f..v0.4.2:
- query_layer's paging test now checks each page's text byte for byte.
  Emptying every page passed all 131 tests before.
- verify_fixture_checksums.py skips dotfiles such as a Finder .DS_Store,
  as the golden coverage test and the SHA256SUMS recipe already do.
- The paged_into comment no longer claims a peak that leaves out the body,
  which is alive while its tree is built.
- The 0.4.2 changelog entry no longer says the old stream parser rejected
  inf and nan. libc++ 18's stream accepted both.
Copilot AI lite review requested due to automatic review settings September 25, 2026 22:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Reddimus
Reddimus merged commit 29e353f into main Sep 25, 2026
12 checks passed
@Reddimus
Reddimus deleted the fix/review-followups branch September 25, 2026 22:50
Reddimus added a commit that referenced this pull request Sep 25, 2026
## Summary

Releases #31: an ArcGIS error object with code 503 is now `RateLimited`,
the same as an HTTP 503 and as the docs say.

- `include/spc/version.hpp`: 0.4.3.
- `CHANGELOG.md`: `[Unreleased]` becomes `[0.4.3] - 2026-09-25`.
- `README.md`: `GIT_TAG v0.4.3`. `find_package(spc 0.4)` stays.

## Testing

`make test` (131/131), `make lint-md`, and `make test-consumers` pass
locally. The consumer check reports "v0.4.3, find_package(spc 0.4)", so
the README's pins match `version.hpp`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants