Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List feeds #1557

Merged
merged 61 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
d7ee9f3
lexicons for block lists
devinivy Aug 28, 2023
a21aa90
reorg blockset functionality into graph service, impl block/mute filt…
devinivy Aug 29, 2023
1a5eae2
apply filterBlocksAndMutes() throughout appview except feeds
devinivy Aug 29, 2023
15d1220
update local feeds to pass through cleanFeedSkeleton(), offload block…
devinivy Aug 29, 2023
b194a58
impl for grabbing block/mute details by did pair
devinivy Aug 30, 2023
0dc8413
refactor getActorInfos away, use actor service
devinivy Aug 30, 2023
c6385f1
Merge remote-tracking branch 'origin/main' into block-lists-redux-redux
devinivy Aug 30, 2023
d571bfe
experiment with moving getFeedGenerators over to a pipeline
devinivy Aug 30, 2023
890c9fc
move getPostThread over to a pipeline
devinivy Aug 30, 2023
57fbaa2
move feeds over to pipelines
devinivy Aug 31, 2023
6712b2e
move suggestions and likes over to pipelines
devinivy Aug 31, 2023
b550d1d
move reposted-by, follows, followers over to pipelines, tidy author f…
devinivy Aug 31, 2023
4f4580c
remove old block/mute checks
devinivy Aug 31, 2023
9801663
unify post presentation logic
devinivy Aug 31, 2023
2a1eced
move profiles endpoints over to pipelines
devinivy Aug 31, 2023
8a72f5a
tidy
devinivy Aug 31, 2023
e5b51c2
tidy
devinivy Sep 1, 2023
541c6c0
Merge remote-tracking branch 'origin/main' into block-lists-redux-redux
devinivy Sep 1, 2023
7ab70f9
Merge remote-tracking branch 'origin/block-lists-redux-redux' into bl…
devinivy Sep 1, 2023
cdcc26b
misc fixes
devinivy Sep 1, 2023
992c25f
unify some profile hydration/presentation in appview
devinivy Sep 1, 2023
da221b0
profile detail, split hydration and presentation, misc fixes
devinivy Sep 2, 2023
a353624
unify feed hydration w/ profile hydration
devinivy Sep 4, 2023
0015729
unify hydration step for embeds, tidy application of labels
devinivy Sep 4, 2023
32f826e
setup indexing of list-blocks in bsky appview
devinivy Sep 4, 2023
ec21246
apply list-blocks, impl getListBlocks, tidy getList, tests
devinivy Sep 5, 2023
eb30fd1
tidy
devinivy Sep 5, 2023
8711f6c
update pds proxy snaps
devinivy Sep 5, 2023
a27b532
Merge remote-tracking branch 'origin/block-lists-redux-redux-pipeline…
devinivy Sep 5, 2023
0265e49
update pds proxy snaps
devinivy Sep 5, 2023
280eb5a
fix snap
devinivy Sep 5, 2023
0dfa73b
make algos return feed items, save work in getFeed
devinivy Sep 6, 2023
0259785
misc changes, tidy
devinivy Sep 6, 2023
c84bc28
tidy
devinivy Sep 6, 2023
c645ed7
Merge pull request #1547 from bluesky-social/block-lists-redux-redux-…
devinivy Sep 6, 2023
d01ae4a
Merge remote-tracking branch 'origin/block-lists-redux-redux' into bl…
devinivy Sep 6, 2023
d704510
Merge branch 'main' into block-lists-redux-redux
dholms Sep 6, 2023
f4918c8
Merge pull request #1549 from bluesky-social/block-lists-redux-redux-…
devinivy Sep 6, 2023
447d7a5
fix aturi import
devinivy Sep 6, 2023
ce1f73f
lex
dholms Sep 6, 2023
e6f8420
list purpose
dholms Sep 6, 2023
1eccea0
lex gen
dholms Sep 7, 2023
59bcb5d
add route
dholms Sep 7, 2023
81ae288
add proxy route
dholms Sep 7, 2023
69a09da
seed client helpers
dholms Sep 7, 2023
20b029f
tests
dholms Sep 7, 2023
9a3af5c
mutes and blocks
dholms Sep 7, 2023
f13c3e5
proxy test
dholms Sep 7, 2023
b150c30
snapshot
dholms Sep 8, 2023
642f975
Merge remote-tracking branch 'origin/main' into block-lists-redux-redux
devinivy Sep 8, 2023
0535368
hoist actors out of composeThread()
devinivy Sep 8, 2023
cb30cff
tidy
devinivy Sep 8, 2023
0c77787
tidy
dholms Sep 11, 2023
d4904d5
merge
dholms Sep 11, 2023
51cd347
run ci on all prs
dholms Sep 12, 2023
36c0606
format
dholms Sep 12, 2023
d0298ea
Merge branch 'block-lists-redux-redux' into list-feed-views
dholms Sep 12, 2023
6b021af
format
dholms Sep 12, 2023
b7a1801
fix snap name
dholms Sep 12, 2023
f77ab80
merge
dholms Sep 12, 2023
1780558
fix snapsh
dholms Sep 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions lexicons/app/bsky/feed/getListFeed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"lexicon": 1,
"id": "app.bsky.feed.getListFeed",
"defs": {
"main": {
"type": "query",
"description": "A view of a recent posts from actors in a list",
"parameters": {
"type": "params",
"required": ["list"],
"properties": {
"list": {"type": "string", "format": "at-uri"},
"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": "app.bsky.feed.defs#feedViewPost"}
}
}
}
},
"errors": [
{"name": "UnknownList"}
]
}
}
}
10 changes: 8 additions & 2 deletions lexicons/app/bsky/graph/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,23 @@
"listPurpose": {
"type": "string",
"knownValues": [
"app.bsky.graph.defs#modlist"
"app.bsky.graph.defs#modlist",
"app.bsky.graph.defs#curatelist"
]
},
"modlist": {
"type": "token",
"description": "A list of actors to apply an aggregate moderation action (mute/block) on"
},
"curatelist": {
"type": "token",
"description": "A list of actors used for curation purposes such as list feeds or interaction gating"
},
"listViewerState": {
"type": "object",
"properties": {
"muted": {"type": "boolean"}
"muted": {"type": "boolean"},
"blocked": {"type": "string", "format": "at-uri"}
}
}
}
Expand Down
31 changes: 31 additions & 0 deletions lexicons/app/bsky/graph/getListBlocks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"lexicon": 1,
"id": "app.bsky.graph.getListBlocks",
"defs": {
"main": {
"type": "query",
"description": "Which lists is the requester's account blocking?",
"parameters": {
"type": "params",
"properties": {
"limit": {"type": "integer", "minimum": 1, "maximum": 100, "default": 50},
"cursor": {"type": "string"}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["lists"],
"properties": {
"cursor": {"type": "string"},
"lists": {
"type": "array",
"items": {"type": "ref", "ref": "app.bsky.graph.defs#listView"}
}
}
}
}
}
}
}
19 changes: 19 additions & 0 deletions lexicons/app/bsky/graph/listblock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"lexicon": 1,
"id": "app.bsky.graph.listblock",
"defs": {
"main": {
"type": "record",
"description": "A block of an entire list of actors.",
"key": "tid",
"record": {
"type": "object",
"required": ["subject", "createdAt"],
"properties": {
"subject": {"type": "string", "format": "at-uri"},
"createdAt": {"type": "string", "format": "datetime"}
}
}
}
}
}
96 changes: 96 additions & 0 deletions packages/api/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ import * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGener
import * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGenerators'
import * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton'
import * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes'
import * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed'
import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread'
import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts'
import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy'
Expand All @@ -110,10 +111,12 @@ import * as AppBskyGraphGetBlocks from './types/app/bsky/graph/getBlocks'
import * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers'
import * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows'
import * as AppBskyGraphGetList from './types/app/bsky/graph/getList'
import * as AppBskyGraphGetListBlocks from './types/app/bsky/graph/getListBlocks'
import * as AppBskyGraphGetListMutes from './types/app/bsky/graph/getListMutes'
import * as AppBskyGraphGetLists from './types/app/bsky/graph/getLists'
import * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes'
import * as AppBskyGraphList from './types/app/bsky/graph/list'
import * as AppBskyGraphListblock from './types/app/bsky/graph/listblock'
import * as AppBskyGraphListitem from './types/app/bsky/graph/listitem'
import * as AppBskyGraphMuteActor from './types/app/bsky/graph/muteActor'
import * as AppBskyGraphMuteActorList from './types/app/bsky/graph/muteActorList'
Expand Down Expand Up @@ -217,6 +220,7 @@ export * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGener
export * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGenerators'
export * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton'
export * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes'
export * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed'
export * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread'
export * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts'
export * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy'
Expand All @@ -232,10 +236,12 @@ export * as AppBskyGraphGetBlocks from './types/app/bsky/graph/getBlocks'
export * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers'
export * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows'
export * as AppBskyGraphGetList from './types/app/bsky/graph/getList'
export * as AppBskyGraphGetListBlocks from './types/app/bsky/graph/getListBlocks'
export * as AppBskyGraphGetListMutes from './types/app/bsky/graph/getListMutes'
export * as AppBskyGraphGetLists from './types/app/bsky/graph/getLists'
export * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes'
export * as AppBskyGraphList from './types/app/bsky/graph/list'
export * as AppBskyGraphListblock from './types/app/bsky/graph/listblock'
export * as AppBskyGraphListitem from './types/app/bsky/graph/listitem'
export * as AppBskyGraphMuteActor from './types/app/bsky/graph/muteActor'
export * as AppBskyGraphMuteActorList from './types/app/bsky/graph/muteActorList'
Expand Down Expand Up @@ -267,6 +273,7 @@ export const COM_ATPROTO_MODERATION = {
}
export const APP_BSKY_GRAPH = {
DefsModlist: 'app.bsky.graph.defs#modlist',
DefsCuratelist: 'app.bsky.graph.defs#curatelist',
}

export class AtpBaseClient {
Expand Down Expand Up @@ -1326,6 +1333,17 @@ export class FeedNS {
})
}

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

getPostThread(
params?: AppBskyFeedGetPostThread.QueryParams,
opts?: AppBskyFeedGetPostThread.CallOptions,
Expand Down Expand Up @@ -1631,13 +1649,15 @@ export class GraphNS {
block: BlockRecord
follow: FollowRecord
list: ListRecord
listblock: ListblockRecord
listitem: ListitemRecord

constructor(service: AtpServiceClient) {
this._service = service
this.block = new BlockRecord(service)
this.follow = new FollowRecord(service)
this.list = new ListRecord(service)
this.listblock = new ListblockRecord(service)
this.listitem = new ListitemRecord(service)
}

Expand Down Expand Up @@ -1685,6 +1705,17 @@ export class GraphNS {
})
}

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

getListMutes(
params?: AppBskyGraphGetListMutes.QueryParams,
opts?: AppBskyGraphGetListMutes.CallOptions,
Expand Down Expand Up @@ -1946,6 +1977,71 @@ export class ListRecord {
}
}

export class ListblockRecord {
_service: AtpServiceClient

constructor(service: AtpServiceClient) {
this._service = service
}

async list(
params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
): Promise<{
cursor?: string
records: { uri: string; value: AppBskyGraphListblock.Record }[]
}> {
const res = await this._service.xrpc.call('com.atproto.repo.listRecords', {
collection: 'app.bsky.graph.listblock',
...params,
})
return res.data
}

async get(
params: Omit<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
): Promise<{
uri: string
cid: string
value: AppBskyGraphListblock.Record
}> {
const res = await this._service.xrpc.call('com.atproto.repo.getRecord', {
collection: 'app.bsky.graph.listblock',
...params,
})
return res.data
}

async create(
params: Omit<
ComAtprotoRepoCreateRecord.InputSchema,
'collection' | 'record'
>,
record: AppBskyGraphListblock.Record,
headers?: Record<string, string>,
): Promise<{ uri: string; cid: string }> {
record.$type = 'app.bsky.graph.listblock'
const res = await this._service.xrpc.call(
'com.atproto.repo.createRecord',
undefined,
{ collection: 'app.bsky.graph.listblock', ...params, record },
{ encoding: 'application/json', headers },
)
return res.data
}

async delete(
params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
headers?: Record<string, string>,
): Promise<void> {
await this._service.xrpc.call(
'com.atproto.repo.deleteRecord',
undefined,
{ collection: 'app.bsky.graph.listblock', ...params },
{ headers },
)
}
}

export class ListitemRecord {
_service: AtpServiceClient

Expand Down
Loading