Skip to content

Fix/versioning docs pagination tests - #325

Merged
valoryyaa-byte merged 4 commits into
RWA-ToolKit:mainfrom
Freezyyy-arch:fix/versioning-docs-pagination-tests
Aug 31, 2026
Merged

Fix/versioning docs pagination tests#325
valoryyaa-byte merged 4 commits into
RWA-ToolKit:mainfrom
Freezyyy-arch:fix/versioning-docs-pagination-tests

Conversation

@Freezyyy-arch

Copy link
Copy Markdown
Contributor

Closes #307
Closes #308
Closes #314
Closes #317

SUMMARY

  1. 24db137 docs(api): explain /v1 vs unversioned route conventions — Added an "API versioning" section to docs/app/docs/api/overview/page.mdx
    explaining that snapshot-backed data routes live under /v1 while /, /version, /health, /metrics stay unversioned operational routes, and what
    happens when /v2 ships.
  2. dda49cb test(pagination): pin offset-beyond-collection-size behavior — Added offset_beyond_collection_size_returns_empty_array to
    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.
  3. acbd42e test(health): pin the snapshot-age threshold that flips 503/degraded — Added a tests module to api/src/routes/mod.rs (none existed
    before) with two tests: a fresh snapshot returns 200/"ok", and a snapshot older than POLL_INTERVAL * 3 returns 503/"degraded".
  4. c4d4892 fix(indexer): track unread compliance records instead of dropping them — In index_compliance_and_holders, a failed get_record RPC
    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.

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.
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@valoryyaa-byte
valoryyaa-byte merged commit a0710fa into RWA-ToolKit:main Aug 31, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment