Repository navigation
Conversation
source.coop#590 pages GET /api/v1/products/{account} as {"items": [...], "next_cursor": ...}, where it answered {"products": [...]} (silently truncated at 50). The account-root ListObjects now asks for pages of 100 and follows next_cursor to the end, and still reads the old unpaged shape, which ignores the query and carries no cursor, so this can deploy before or after source.coop. The stub and the nightly contract test move to the new shape; the contract test accepts either until source.coop deploys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
🚀 Latest commit deployed to https://source-data-proxy-pr-253.source-coop.workers.dev
|
This branch was successfully deployed
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.
source-cooperative/source.coop#590 (#651) pages
GET /api/v1/products/{account}: it answers{"items": [...], "next_cursor": ...}where it answered{"products": [...]}, which was also silently cut off at 50. TodaySourceProductListrequiresproducts, so once that deploys every S3 ListObjects at an account root (s3://{account}/) would fail to parse and answer 500 — while CI stayed green, because the stub serves the old shape.The account-root listing now asks for
?limit=100and followsnext_cursoruntil there is none, collecting every product ID.itemsalso acceptsproductsas an alias, and the current API ignores the query and sends no cursor, so this reads one unpaged list from it exactly as before: this can merge and deploy before or after source.coop, which is the point.Each page is its own URL, so each is cached for
PRODUCT_LIST_CACHE_SECSon its own; an account with more than 100 products costs one API call per 100 on a cold listing, where today it silently lists only the first 50. ADR-007's lookup table still holds (same URL, same anonymous caller, same 60s per response), so it isn't amended.Tests:
tests/stub_api.pyserves the new shape;fixtures.rspins the paged, last-page and old unpaged shapes; the nightlytest_contract.pyasks for?limit=100and readsitems, falling back toproductsuntil source.coop deploys, after which the fallback can go.cargo test,cargo fmt --checkandcargo clippy --target wasm32-unknown-unknown -- -D warningspass locally.🤖 Generated with Claude Code