From 3a53a01f1dcf713558802d7924c3aa3bce5fb477 Mon Sep 17 00:00:00 2001 From: scanash00 Date: Fri, 12 Jun 2026 11:30:56 -0800 Subject: [PATCH] Request public skeleton (no auth) from the batch proxy for all users Confirmed with a real service-auth token in-app: Slingshot's batch proxy returns 400 for ANY authorization value (Bearer or raw) - it can't forward auth to the generator server-side, the schema field notwithstanding. So sending a token just guaranteed a 400 + wasted round-trip before the AppView fallback. Now the batch path runs for everyone but never sends auth: logged-in users still get the fast one-request batch hydration on feeds with a usable public skeleton (Discover etc.), and personalized feeds that need viewer auth fall through to the AppView. The getAuthorization plumbing stays in place for if/when the proxy supports forwarded auth. --- src/lib/api/feed/custom.ts | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/lib/api/feed/custom.ts b/src/lib/api/feed/custom.ts index 497d700..63fcbac 100644 --- a/src/lib/api/feed/custom.ts +++ b/src/lib/api/feed/custom.ts @@ -53,29 +53,18 @@ export class CustomFeedAPI implements FeedAPI { limit: number }): Promise { // Microcosm batch path: Slingshot proxies the feed generator's skeleton and - // fetches all post records in one request. For personalized feeds we forward - // a service-auth token (aud = the feed generator's DID) so the generator can - // identify the viewer, exactly as the AppView would. + // fetches all post records in one request. We request the PUBLIC skeleton + // (no auth): Slingshot's batch proxy can't forward a service-auth token (it + // returns 400 for any `authorization` value), so we don't send one. Most + // feeds (Discover, what's-hot, etc.) have a usable public skeleton even for + // logged-in users. Truly personalized feeds return little/nothing here and + // fall through to the AppView below, which forwards the viewer's auth. if (MICROCOSM_ENABLED) { try { const page = await buildCustomFeed(this.params.feed, { viewerDid: this.agent.did, limit, cursor, - getAuthorization: this.agent.did - ? async (feedGenDid: string) => { - try { - const {data} = - await this.agent.com.atproto.server.getServiceAuth({ - aud: feedGenDid, - lxm: 'app.bsky.feed.getFeedSkeleton', - }) - return data.token - } catch { - return undefined - } - } - : undefined, }) if (page.feed.length) { return {cursor: page.cursor, feed: page.feed} -- 2.51.2