Fix/versioning docs pagination tests - #325
Merged
valoryyaa-byte merged 4 commits intoAug 31, 2026
Merged
Conversation
The router nests all snapshot-backed data routes under /v1 while keeping /, /version, /health and /metrics unversioned, but the docs site never explained the scheme. Add a section to the API overview page so integrators know which endpoints are stable-versioned data routes vs. unversioned operational routes, and what happens when /v2 ships.
Neither assets.rs nor holders.rs had a test for ?offset= larger than the collection size. Iterator::skip handles it gracefully today (empty array, 200 OK), but nothing pinned that behavior, so a future refactor of the pagination logic could silently regress it. Add a test to each route.
The health handler compares snapshot_age_seconds against POLL_INTERVAL * 3 and returns 503 with status "degraded" when stale, but no test constructed a snapshot with an old last_updated to prove the threshold actually trips. Add tests for both the fresh (200/ok) and stale (503/degraded) paths.
In index_compliance_and_holders, total_records was incremented for every allowlisted address, but if the per-address get_record RPC call failed, none of approved/suspended/rejected/pending/with_expiry/jurisdictions were incremented for it — so the status counts silently stopped summing to total_records, contradicting the invariant asserted in RWA-ToolKit#267. Add a `unread` field to ComplianceSummary and increment it when a record read fails, so the address is tracked rather than vanishing. Update the OpenAPI schema, compliance docs page, and add a test pinning the accounting invariant with unread included.
|
@Freezyyy-arch Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #307
Closes #308
Closes #314
Closes #317
SUMMARY
explaining that snapshot-backed data routes live under /v1 while /, /version, /health, /metrics stay unversioned operational routes, and what
happens when /v2 ships.
api/src/routes/assets.rs and offset_beyond_holder_count_returns_empty_array to api/src/routes/holders.rs, pinning that an offset past the end
returns 200 OK with an empty array rather than an error.
before) with two tests: a fresh snapshot returns 200/"ok", and a snapshot older than POLL_INTERVAL * 3 returns 503/"degraded".
call previously left the address uncounted anywhere except total_records, breaking the invariant that the status buckets sum to
total_records. Added a new unread: usize field to ComplianceSummary, incremented on read failure, plus a unit test pinning approved +
suspended + rejected + pending + unread == total_records. Updated the OpenAPI schema and the compliance docs page to document the new field.