Repository navigation
Hydrate from the public AppView instead of users' sessions - #15
ngerakines wants to merge 1 commit into
Conversation
Startup no longer fetches account session strings from the Graze API, and hydration no longer resumes (and refreshes) those sessions to call getProfiles/getPosts through users' PDSes. One unauthenticated client against PUBLIC_APPVIEW_URL (default https://public.api.bsky.app) makes the same calls, 25 per page, into the same models and caches. 429, 5xx and network failures are retried with exponential backoff and jitter, waiting at least what Retry-After / ratelimit-reset asks (bounded by APPVIEW_MAX_RETRY_AFTER_SECONDS). A page that still fails leaves that metadata empty and the records go out as before. New counters: jetstream_turbo_appview_requests_total{endpoint,status_class}, _rate_limited_total, _retries_total and _failures_total. Removed: graze_api.py, session loading, CLIENT_BANDWIDTH, TURBO_CREDENTIAL_SECRET and graze_api_base_url. Viewer fields are no longer populated (e.g. hydrated_metadata.user.viewer.known_followers.count).
|
Production has been hydrating from the public AppView since 2026-12-02 13:45Z, through an overlay rather than a build of this branch. What is running: an image built
Before main can be rolled: main only writes to S3 and Redis when Comparison before the switch: audit mode ran this code on a shard of the firehose into a separate stream.
|
Hydration now reads profiles and posts from Bluesky's public AppView, unauthenticated, instead of resuming stored account sessions. Startup no longer fetches session strings from the Graze API.
PUBLIC_APPVIEW_URL(defaulthttps://public.api.bsky.app) makes the samegetProfiles/getPostscalls, 25 per page, into the same models and caches.Retry-After/ratelimit-resetasks, capped byAPPVIEW_MAX_RETRY_AFTER_SECONDS. A page that still fails leaves that metadata empty, and the records go out as before.jetstream_turbo_appview_requests_total{endpoint,status_class},_rate_limited_total,_retries_totaland_failures_total. They measure the public AppView's rate limits, which are not known yet.graze_api.py, session loading,CLIENT_BANDWIDTH,TURBO_CREDENTIAL_SECRETandgraze_api_base_url.Behaviour change
Results are viewer-neutral. Viewer fields are no longer populated; for example,
hydrated_metadata.user.viewer.known_followers.countis now null.Checks
pytest: 47 passed, includingtests/test_public_appview.py(backoff, Retry-After, batching, and no credentials in settings).Rollout
Merging deploys. Run it first beside the current deployment and compare output, then switch over.