Skip to content

Commit

Permalink
Remove appview feedgen (bluesky-social#2106)
Browse files Browse the repository at this point in the history
* remove appview feedgen

* deprecate getTimelineSkeleton

* fix dev-env build

* rm unused test
  • Loading branch information
dholms authored Jan 30, 2024
1 parent 8da034a commit f023494
Show file tree
Hide file tree
Showing 32 changed files with 63 additions and 1,720 deletions.
40 changes: 0 additions & 40 deletions lexicons/app/bsky/unspecced/getTimelineSkeleton.json

This file was deleted.

13 changes: 0 additions & 13 deletions packages/api/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ import * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet'
import * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs'
import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators'
import * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecced/getTaggedSuggestions'
import * as AppBskyUnspeccedGetTimelineSkeleton from './types/app/bsky/unspecced/getTimelineSkeleton'
import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton'
import * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton'

Expand Down Expand Up @@ -297,7 +296,6 @@ export * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet'
export * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs'
export * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators'
export * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecced/getTaggedSuggestions'
export * as AppBskyUnspeccedGetTimelineSkeleton from './types/app/bsky/unspecced/getTimelineSkeleton'
export * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton'
export * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton'

Expand Down Expand Up @@ -2547,17 +2545,6 @@ export class AppBskyUnspeccedNS {
})
}

getTimelineSkeleton(
params?: AppBskyUnspeccedGetTimelineSkeleton.QueryParams,
opts?: AppBskyUnspeccedGetTimelineSkeleton.CallOptions,
): Promise<AppBskyUnspeccedGetTimelineSkeleton.Response> {
return this._service.xrpc
.call('app.bsky.unspecced.getTimelineSkeleton', params, undefined, opts)
.catch((e) => {
throw AppBskyUnspeccedGetTimelineSkeleton.toKnownErr(e)
})
}

searchActorsSkeleton(
params?: AppBskyUnspeccedSearchActorsSkeleton.QueryParams,
opts?: AppBskyUnspeccedSearchActorsSkeleton.CallOptions,
Expand Down
50 changes: 0 additions & 50 deletions packages/api/src/client/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8100,55 +8100,6 @@ export const schemaDict = {
},
},
},
AppBskyUnspeccedGetTimelineSkeleton: {
lexicon: 1,
id: 'app.bsky.unspecced.getTimelineSkeleton',
defs: {
main: {
type: 'query',
description:
'DEPRECATED: a skeleton of a timeline. Unspecced and will be unavailable soon.',
parameters: {
type: 'params',
properties: {
limit: {
type: 'integer',
minimum: 1,
maximum: 100,
default: 50,
},
cursor: {
type: 'string',
},
},
},
output: {
encoding: 'application/json',
schema: {
type: 'object',
required: ['feed'],
properties: {
cursor: {
type: 'string',
},
feed: {
type: 'array',
items: {
type: 'ref',
ref: 'lex:app.bsky.feed.defs#skeletonFeedPost',
},
},
},
},
},
errors: [
{
name: 'UnknownFeed',
},
],
},
},
},
AppBskyUnspeccedSearchActorsSkeleton: {
lexicon: 1,
id: 'app.bsky.unspecced.searchActorsSkeleton',
Expand Down Expand Up @@ -8438,7 +8389,6 @@ export const ids = {
'app.bsky.unspecced.getPopularFeedGenerators',
AppBskyUnspeccedGetTaggedSuggestions:
'app.bsky.unspecced.getTaggedSuggestions',
AppBskyUnspeccedGetTimelineSkeleton: 'app.bsky.unspecced.getTimelineSkeleton',
AppBskyUnspeccedSearchActorsSkeleton:
'app.bsky.unspecced.searchActorsSkeleton',
AppBskyUnspeccedSearchPostsSkeleton: 'app.bsky.unspecced.searchPostsSkeleton',
Expand Down

This file was deleted.

21 changes: 0 additions & 21 deletions packages/bsky/src/api/app/bsky/feed/describeFeedGenerator.ts

This file was deleted.

12 changes: 7 additions & 5 deletions packages/bsky/src/api/app/bsky/feed/getFeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { OutputSchema as SkeletonOutput } from '../../../../lexicon/types/app/bs
import { SkeletonFeedPost } from '../../../../lexicon/types/app/bsky/feed/defs'
import { Server } from '../../../../lexicon'
import AppContext from '../../../../context'
import { AlgoResponse } from '../../../../feed-gen/types'
import { Database } from '../../../../db'
import {
FeedHydrationState,
Expand Down Expand Up @@ -71,16 +70,13 @@ const skeleton = async (
ctx: Context,
): Promise<SkeletonState> => {
const timerSkele = new ServerTimer('skele').start()
const localAlgo = ctx.appCtx.algos[params.feed]
const feedParams: GetFeedParams = {
feed: params.feed,
limit: params.limit,
cursor: params.cursor,
}
const { feedItems, cursor, resHeaders, ...passthrough } =
localAlgo !== undefined
? await localAlgo(ctx.appCtx, params, params.viewer)
: await skeletonFromFeedGen(ctx, feedParams)
await skeletonFromFeedGen(ctx, feedParams)
return {
params,
cursor,
Expand Down Expand Up @@ -152,6 +148,12 @@ type SkeletonState = {
type HydrationState = SkeletonState &
FeedHydrationState & { feedItems: FeedRow[]; timerHydr: ServerTimer }

type AlgoResponse = {
feedItems: FeedRow[]
resHeaders?: Record<string, string>
cursor?: string
}

const skeletonFromFeedGen = async (
ctx: Context,
params: GetFeedParams,
Expand Down
30 changes: 0 additions & 30 deletions packages/bsky/src/api/app/bsky/feed/getFeedSkeleton.ts

This file was deleted.

27 changes: 0 additions & 27 deletions packages/bsky/src/api/app/bsky/unspecced/getTimelineSkeleton.ts

This file was deleted.

6 changes: 0 additions & 6 deletions packages/bsky/src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { Server } from '../lexicon'
import AppContext from '../context'
import describeFeedGenerator from './app/bsky/feed/describeFeedGenerator'
import getTimeline from './app/bsky/feed/getTimeline'
import getActorFeeds from './app/bsky/feed/getActorFeeds'
import getSuggestedFeeds from './app/bsky/feed/getSuggestedFeeds'
import getAuthorFeed from './app/bsky/feed/getAuthorFeed'
import getFeed from './app/bsky/feed/getFeed'
import getFeedGenerator from './app/bsky/feed/getFeedGenerator'
import getFeedGenerators from './app/bsky/feed/getFeedGenerators'
import getFeedSkeleton from './app/bsky/feed/getFeedSkeleton'
import getLikes from './app/bsky/feed/getLikes'
import getListFeed from './app/bsky/feed/getListFeed'
import getPostThread from './app/bsky/feed/getPostThread'
Expand Down Expand Up @@ -40,7 +38,6 @@ import listNotifications from './app/bsky/notification/listNotifications'
import updateSeen from './app/bsky/notification/updateSeen'
import registerPush from './app/bsky/notification/registerPush'
import getPopularFeedGenerators from './app/bsky/unspecced/getPopularFeedGenerators'
import getTimelineSkeleton from './app/bsky/unspecced/getTimelineSkeleton'
import getTaggedSuggestions from './app/bsky/unspecced/getTaggedSuggestions'
import getSubjectStatus from './com/atproto/admin/getSubjectStatus'
import updateSubjectStatus from './com/atproto/admin/updateSubjectStatus'
Expand All @@ -57,15 +54,13 @@ export * as blobResolver from './blob-resolver'

export default function (server: Server, ctx: AppContext) {
// app.bsky
describeFeedGenerator(server, ctx)
getTimeline(server, ctx)
getActorFeeds(server, ctx)
getSuggestedFeeds(server, ctx)
getAuthorFeed(server, ctx)
getFeed(server, ctx)
getFeedGenerator(server, ctx)
getFeedGenerators(server, ctx)
getFeedSkeleton(server, ctx)
getLikes(server, ctx)
getListFeed(server, ctx)
getPostThread(server, ctx)
Expand Down Expand Up @@ -97,7 +92,6 @@ export default function (server: Server, ctx: AppContext) {
updateSeen(server, ctx)
registerPush(server, ctx)
getPopularFeedGenerators(server, ctx)
getTimelineSkeleton(server, ctx)
getTaggedSuggestions(server, ctx)
// com.atproto
getSubjectStatus(server, ctx)
Expand Down
6 changes: 0 additions & 6 deletions packages/bsky/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { ImageUriBuilder } from './image/uri'
import { Services } from './services'
import DidRedisCache from './did-cache'
import { BackgroundQueue } from './background'
import { MountedAlgos } from './feed-gen/types'
import { Redis } from './redis'
import { AuthVerifier } from './auth-verifier'
import { BsyncClient } from './bsync'
Expand All @@ -30,7 +29,6 @@ export class AppContext {
searchAgent?: AtpAgent
bsyncClient?: BsyncClient
courierClient?: CourierClient
algos: MountedAlgos
authVerifier: AuthVerifier
},
) {}
Expand Down Expand Up @@ -99,10 +97,6 @@ export class AppContext {
get backgroundQueue(): BackgroundQueue {
return this.opts.backgroundQueue
}

get algos(): MountedAlgos {
return this.opts.algos
}
}

export default AppContext
Loading

0 comments on commit f023494

Please sign in to comment.