Repository navigation
Add four recipes for a public API's habits - #54
Merged
Merged
Conversation
A budgeted transport, a Json scalar read as a value, fields a server nulls by path, and an unpaged collection into the image, as #52 asks. The code was compiled in both runtimes against AniList's schema in scratch hosts, and the budget run over a scripted base transport.
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.
Answers #52 with four recipes, each with its Swift and Kotlin halves. None adds a concept.
docs/recipes/budgeted-transport.md: a wrapper around the one verb that holds one request in flight, sends a write before a refresh before a browse page, meters the sends under the server's limit, pauses every request for a minute after a 429, and turns AniList's outage 403 into an error of the app's. A handle'sfetchcarries that error beside the data, and the view shows a calm line. The built-in transports keep a refused response's status and body but not its headers, soRetry-Afteris not read and the wait is the full minute. The page says so.docs/recipes/json-scalar.md:customLists(asArray: true)read as a mapped type. Checked against the live API, it is an array of{name, enabled}objects, not of names. The page sayscustomScalarTypesmaps a scalar, not a field, and that a map stays a type of the app's, never a dictionary on the read path.docs/recipes/fields-by-path.md: what a list fragment selects, where path-dependent and viewer-dependent fields go, and a probe that tells them apart. An anonymous request on 2026-10-18 gotvoiceActorsfilled underPage.media, so the page cites the report rather than stating it.docs/recipes/unpaged-collection.md:MediaListCollectionas one operation with a long@cacheExpiration, grouped on the client from each entry's own fields, so a mutation's response moves the row with no updater. The image carries it to the next launch.Linked from the README,
docs/README.mdand the site's Recipes section. CHANGELOG entry under Unreleased.Checks: every code block was compiled in scratch hosts over AniList's schema, a Swift target built with
BATON_COMPILER=localand-warnings-as-errorsand a Kotlin module withcompileKotlinJvm, then deleted. The budget was also run over a scripted base transport in both runtimes.scripts/check-boundaries.sh,scripts/hostile-name-sweep.py, the site build, andcargo fmt --checkand clippy onsite/pass. No Swift, Kotlin or compiler source changed, so those suites were not run again.