@atproto/bsky 0.0.76 → 0.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/api/app/bsky/feed/getActorLikes.js +2 -2
- package/dist/api/app/bsky/feed/getActorLikes.js.map +1 -1
- package/dist/api/app/bsky/feed/getLikes.js +6 -6
- package/dist/api/app/bsky/feed/getLikes.js.map +1 -1
- package/dist/api/app/bsky/feed/getListFeed.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getListFeed.js +19 -3
- package/dist/api/app/bsky/feed/getListFeed.js.map +1 -1
- package/dist/api/app/bsky/feed/getPosts.js +4 -4
- package/dist/api/app/bsky/feed/getPosts.js.map +1 -1
- package/dist/api/app/bsky/feed/getQuotes.d.ts +4 -0
- package/dist/api/app/bsky/feed/getQuotes.d.ts.map +1 -0
- package/dist/api/app/bsky/feed/getQuotes.js +67 -0
- package/dist/api/app/bsky/feed/getQuotes.js.map +1 -0
- package/dist/api/app/bsky/feed/getRepostedBy.js +6 -6
- package/dist/api/app/bsky/feed/getRepostedBy.js.map +1 -1
- package/dist/api/app/bsky/feed/searchPosts.js +4 -4
- package/dist/api/app/bsky/feed/searchPosts.js.map +1 -1
- package/dist/api/app/bsky/graph/getFollowers.js +8 -8
- package/dist/api/app/bsky/graph/getFollowers.js.map +1 -1
- package/dist/api/app/bsky/graph/getList.js +7 -7
- package/dist/api/app/bsky/graph/getList.js.map +1 -1
- package/dist/api/app/bsky/notification/listNotifications.d.ts.map +1 -1
- package/dist/api/app/bsky/notification/listNotifications.js +29 -8
- package/dist/api/app/bsky/notification/listNotifications.js.map +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +2 -0
- package/dist/api/index.js.map +1 -1
- package/dist/data-plane/server/db/database-schema.d.ts +4 -2
- package/dist/data-plane/server/db/database-schema.d.ts.map +1 -1
- package/dist/data-plane/server/db/migrations/20240723T220700077Z-quotes-post-aggs.d.ts +4 -0
- package/dist/data-plane/server/db/migrations/20240723T220700077Z-quotes-post-aggs.d.ts.map +1 -0
- package/dist/data-plane/server/db/migrations/20240723T220700077Z-quotes-post-aggs.js +15 -0
- package/dist/data-plane/server/db/migrations/20240723T220700077Z-quotes-post-aggs.js.map +1 -0
- package/dist/data-plane/server/db/migrations/20240723T220703655Z-quotes.d.ts +4 -0
- package/dist/data-plane/server/db/migrations/20240723T220703655Z-quotes.d.ts.map +1 -0
- package/dist/data-plane/server/db/migrations/20240723T220703655Z-quotes.js +30 -0
- package/dist/data-plane/server/db/migrations/20240723T220703655Z-quotes.js.map +1 -0
- package/dist/data-plane/server/db/migrations/20240801T193939827Z-post-gate.d.ts +4 -0
- package/dist/data-plane/server/db/migrations/20240801T193939827Z-post-gate.d.ts.map +1 -0
- package/dist/data-plane/server/db/migrations/20240801T193939827Z-post-gate.js +20 -0
- package/dist/data-plane/server/db/migrations/20240801T193939827Z-post-gate.js.map +1 -0
- package/dist/data-plane/server/db/migrations/20240808T224251220Z-post-gate-flags.d.ts +4 -0
- package/dist/data-plane/server/db/migrations/20240808T224251220Z-post-gate-flags.d.ts.map +1 -0
- package/dist/data-plane/server/db/migrations/20240808T224251220Z-post-gate-flags.js +28 -0
- package/dist/data-plane/server/db/migrations/20240808T224251220Z-post-gate-flags.js.map +1 -0
- package/dist/data-plane/server/db/migrations/index.d.ts +4 -0
- package/dist/data-plane/server/db/migrations/index.d.ts.map +1 -1
- package/dist/data-plane/server/db/migrations/index.js +5 -1
- package/dist/data-plane/server/db/migrations/index.js.map +1 -1
- package/dist/data-plane/server/db/tables/post-agg.d.ts +1 -0
- package/dist/data-plane/server/db/tables/post-agg.d.ts.map +1 -1
- package/dist/data-plane/server/db/tables/post-gate.d.ts +14 -0
- package/dist/data-plane/server/db/tables/post-gate.d.ts.map +1 -0
- package/dist/data-plane/server/db/tables/post-gate.js +4 -0
- package/dist/data-plane/server/db/tables/post-gate.js.map +1 -0
- package/dist/data-plane/server/db/tables/post.d.ts +3 -0
- package/dist/data-plane/server/db/tables/post.d.ts.map +1 -1
- package/dist/data-plane/server/db/tables/quote.d.ts +16 -0
- package/dist/data-plane/server/db/tables/quote.d.ts.map +1 -0
- package/dist/data-plane/server/db/tables/quote.js +4 -0
- package/dist/data-plane/server/db/tables/quote.js.map +1 -0
- package/dist/data-plane/server/indexing/index.d.ts +2 -0
- package/dist/data-plane/server/indexing/index.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/index.js +6 -0
- package/dist/data-plane/server/indexing/index.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/post-gate.d.ts +10 -0
- package/dist/data-plane/server/indexing/plugins/post-gate.d.ts.map +1 -0
- package/dist/data-plane/server/indexing/plugins/post-gate.js +101 -0
- package/dist/data-plane/server/indexing/plugins/post-gate.js.map +1 -0
- package/dist/data-plane/server/indexing/plugins/post.d.ts +2 -0
- package/dist/data-plane/server/indexing/plugins/post.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/post.js +122 -15
- package/dist/data-plane/server/indexing/plugins/post.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/thread-gate.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/thread-gate.js +12 -0
- package/dist/data-plane/server/indexing/plugins/thread-gate.js.map +1 -1
- package/dist/data-plane/server/routes/index.d.ts.map +1 -1
- package/dist/data-plane/server/routes/index.js +2 -0
- package/dist/data-plane/server/routes/index.js.map +1 -1
- package/dist/data-plane/server/routes/interactions.d.ts.map +1 -1
- package/dist/data-plane/server/routes/interactions.js +2 -1
- package/dist/data-plane/server/routes/interactions.js.map +1 -1
- package/dist/data-plane/server/routes/quotes.d.ts +6 -0
- package/dist/data-plane/server/routes/quotes.d.ts.map +1 -0
- package/dist/data-plane/server/routes/quotes.js +27 -0
- package/dist/data-plane/server/routes/quotes.js.map +1 -0
- package/dist/data-plane/server/routes/records.d.ts.map +1 -1
- package/dist/data-plane/server/routes/records.js +11 -1
- package/dist/data-plane/server/routes/records.js.map +1 -1
- package/dist/data-plane/server/util.d.ts +6 -7
- package/dist/data-plane/server/util.d.ts.map +1 -1
- package/dist/data-plane/server/util.js +1 -9
- package/dist/data-plane/server/util.js.map +1 -1
- package/dist/hydration/feed.d.ts +10 -0
- package/dist/hydration/feed.d.ts.map +1 -1
- package/dist/hydration/feed.js +31 -7
- package/dist/hydration/feed.js.map +1 -1
- package/dist/hydration/hydrator.d.ts +4 -2
- package/dist/hydration/hydrator.d.ts.map +1 -1
- package/dist/hydration/hydrator.js +89 -34
- package/dist/hydration/hydrator.js.map +1 -1
- package/dist/hydration/util.d.ts +0 -1
- package/dist/hydration/util.d.ts.map +1 -1
- package/dist/hydration/util.js +1 -5
- package/dist/hydration/util.js.map +1 -1
- package/dist/lexicon/index.d.ts +2 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +4 -0
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +144 -0
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +146 -1
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/embed/record.d.ts +9 -1
- package/dist/lexicon/types/app/bsky/embed/record.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/embed/record.js +11 -1
- package/dist/lexicon/types/app/bsky/embed/record.js.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts +2 -0
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/getQuotes.d.ts +44 -0
- package/dist/lexicon/types/app/bsky/feed/getQuotes.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/feed/getQuotes.js +3 -0
- package/dist/lexicon/types/app/bsky/feed/getQuotes.js.map +1 -0
- package/dist/lexicon/types/app/bsky/feed/postgate.d.ts +25 -0
- package/dist/lexicon/types/app/bsky/feed/postgate.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/feed/postgate.js +27 -0
- package/dist/lexicon/types/app/bsky/feed/postgate.js.map +1 -0
- package/dist/lexicon/types/app/bsky/feed/threadgate.d.ts +2 -0
- package/dist/lexicon/types/app/bsky/feed/threadgate.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/threadgate.js.map +1 -1
- package/dist/proto/bsky_connect.d.ts +30 -1
- package/dist/proto/bsky_connect.d.ts.map +1 -1
- package/dist/proto/bsky_connect.js +29 -0
- package/dist/proto/bsky_connect.js.map +1 -1
- package/dist/proto/bsky_pb.d.ts +135 -1
- package/dist/proto/bsky_pb.d.ts.map +1 -1
- package/dist/proto/bsky_pb.js +425 -5
- package/dist/proto/bsky_pb.js.map +1 -1
- package/dist/util/uris.d.ts +12 -0
- package/dist/util/uris.d.ts.map +1 -0
- package/dist/util/uris.js +34 -0
- package/dist/util/uris.js.map +1 -0
- package/dist/views/index.d.ts +8 -2
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/index.js +84 -39
- package/dist/views/index.js.map +1 -1
- package/dist/views/types.d.ts +1 -1
- package/dist/views/types.d.ts.map +1 -1
- package/dist/views/types.js.map +1 -1
- package/dist/views/util.d.ts +11 -1
- package/dist/views/util.d.ts.map +1 -1
- package/dist/views/util.js +19 -8
- package/dist/views/util.js.map +1 -1
- package/package.json +4 -4
- package/proto/bsky.proto +42 -2
- package/src/api/app/bsky/feed/getActorLikes.ts +1 -1
- package/src/api/app/bsky/feed/getLikes.ts +1 -1
- package/src/api/app/bsky/feed/getListFeed.ts +30 -3
- package/src/api/app/bsky/feed/getPosts.ts +1 -1
- package/src/api/app/bsky/feed/getQuotes.ts +108 -0
- package/src/api/app/bsky/feed/getRepostedBy.ts +1 -1
- package/src/api/app/bsky/feed/searchPosts.ts +1 -1
- package/src/api/app/bsky/graph/getFollowers.ts +1 -1
- package/src/api/app/bsky/graph/getList.ts +5 -5
- package/src/api/app/bsky/notification/listNotifications.ts +32 -6
- package/src/api/index.ts +2 -0
- package/src/data-plane/server/db/database-schema.ts +7 -3
- package/src/data-plane/server/db/migrations/20240723T220700077Z-quotes-post-aggs.ts +12 -0
- package/src/data-plane/server/db/migrations/20240723T220703655Z-quotes.ts +28 -0
- package/src/data-plane/server/db/migrations/20240801T193939827Z-post-gate.ts +17 -0
- package/src/data-plane/server/db/migrations/20240808T224251220Z-post-gate-flags.ts +25 -0
- package/src/data-plane/server/db/migrations/index.ts +4 -0
- package/src/data-plane/server/db/tables/post-agg.ts +1 -0
- package/src/data-plane/server/db/tables/post-gate.ts +12 -0
- package/src/data-plane/server/db/tables/post.ts +3 -0
- package/src/data-plane/server/db/tables/quote.ts +15 -0
- package/src/data-plane/server/indexing/index.ts +7 -0
- package/src/data-plane/server/indexing/plugins/post-gate.ts +104 -0
- package/src/data-plane/server/indexing/plugins/post.ts +151 -16
- package/src/data-plane/server/indexing/plugins/thread-gate.ts +12 -0
- package/src/data-plane/server/routes/index.ts +2 -0
- package/src/data-plane/server/routes/interactions.ts +2 -1
- package/src/data-plane/server/routes/quotes.ts +32 -0
- package/src/data-plane/server/routes/records.ts +11 -1
- package/src/data-plane/server/util.ts +0 -8
- package/src/hydration/feed.ts +58 -12
- package/src/hydration/hydrator.ts +94 -22
- package/src/hydration/util.ts +0 -4
- package/src/lexicon/index.ts +12 -0
- package/src/lexicon/lexicons.ts +149 -1
- package/src/lexicon/types/app/bsky/embed/record.ts +20 -0
- package/src/lexicon/types/app/bsky/feed/defs.ts +2 -0
- package/src/lexicon/types/app/bsky/feed/getQuotes.ts +54 -0
- package/src/lexicon/types/app/bsky/feed/postgate.ts +47 -0
- package/src/lexicon/types/app/bsky/feed/threadgate.ts +2 -0
- package/src/proto/bsky_connect.ts +35 -0
- package/src/proto/bsky_pb.ts +424 -1
- package/src/util/uris.ts +31 -0
- package/src/views/index.ts +91 -35
- package/src/views/types.ts +1 -0
- package/src/views/util.ts +37 -7
- package/tests/__snapshots__/feed-generation.test.ts.snap +42 -0
- package/tests/data-plane/__snapshots__/indexing.test.ts.snap +20 -0
- package/tests/data-plane/indexing.test.ts +1 -0
- package/tests/postgates.test.ts +186 -0
- package/tests/seed/feed-hidden-replies.ts +62 -0
- package/tests/seed/postgates.ts +56 -0
- package/tests/views/__snapshots__/author-feed.test.ts.snap +65 -0
- package/tests/views/__snapshots__/block-lists.test.ts.snap +7 -0
- package/tests/views/__snapshots__/blocks.test.ts.snap +11 -0
- package/tests/views/__snapshots__/list-feed.test.ts.snap +24 -0
- package/tests/views/__snapshots__/lists.test.ts.snap +185 -1
- package/tests/views/__snapshots__/mute-lists.test.ts.snap +8 -0
- package/tests/views/__snapshots__/mutes.test.ts.snap +6 -0
- package/tests/views/__snapshots__/posts.test.ts.snap +15 -0
- package/tests/views/__snapshots__/quotes.test.ts.snap +402 -0
- package/tests/views/__snapshots__/thread.test.ts.snap +50 -0
- package/tests/views/__snapshots__/timeline.test.ts.snap +191 -0
- package/tests/views/author-feed.test.ts +3 -9
- package/tests/views/feed-hidden-replies.test.ts +246 -0
- package/tests/views/feed-view-post.test.ts +501 -0
- package/tests/views/list-feed.test.ts +12 -0
- package/tests/views/lists.test.ts +83 -18
- package/tests/views/quotes.test.ts +105 -0
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
import { AtpAgent, AppBskyFeedDefs, AtUri } from '@atproto/api'
|
|
2
|
+
import { TestNetwork, SeedClient, basicSeed } from '@atproto/dev-env'
|
|
3
|
+
import { ids } from '../../src/lexicon/lexicons'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The frontend computes feed slices for display using at-most one
|
|
7
|
+
* `FeedViewPost` slice. If that slice results in an "orphaned" thread e.g.
|
|
8
|
+
* parent or root is blocked, that slice is tossed out and the next
|
|
9
|
+
* `FeedViewPost` slice is considered. That process continues until a
|
|
10
|
+
* contiguous `root -> child` slice can be found.
|
|
11
|
+
*
|
|
12
|
+
* For the tests below, we test with up to 4 slices: one root and up to 3
|
|
13
|
+
* replies. Some tests focus on the first slice, and others ensure that at
|
|
14
|
+
* least one contiguous slice is returned.
|
|
15
|
+
*/
|
|
16
|
+
const LIMIT = 4
|
|
17
|
+
|
|
18
|
+
describe('pds thread views', () => {
|
|
19
|
+
let network: TestNetwork
|
|
20
|
+
let agent: AtpAgent
|
|
21
|
+
let pdsAgent: AtpAgent
|
|
22
|
+
let sc: SeedClient
|
|
23
|
+
|
|
24
|
+
// account dids, for convenience
|
|
25
|
+
let alice: string
|
|
26
|
+
let bob: string
|
|
27
|
+
let carol: string
|
|
28
|
+
let dan: string
|
|
29
|
+
|
|
30
|
+
beforeAll(async () => {
|
|
31
|
+
network = await TestNetwork.create({
|
|
32
|
+
dbPostgresSchema: 'bsky_views_feed_view_post',
|
|
33
|
+
})
|
|
34
|
+
agent = network.bsky.getClient()
|
|
35
|
+
pdsAgent = network.pds.getClient()
|
|
36
|
+
sc = network.getSeedClient()
|
|
37
|
+
await basicSeed(sc)
|
|
38
|
+
alice = sc.dids.alice
|
|
39
|
+
bob = sc.dids.bob
|
|
40
|
+
carol = sc.dids.carol
|
|
41
|
+
dan = sc.dids.dan
|
|
42
|
+
|
|
43
|
+
await sc.follow(carol, alice)
|
|
44
|
+
await sc.follow(carol, bob)
|
|
45
|
+
await sc.follow(carol, dan)
|
|
46
|
+
await sc.follow(dan, alice)
|
|
47
|
+
await sc.follow(dan, bob)
|
|
48
|
+
await sc.follow(dan, carol)
|
|
49
|
+
|
|
50
|
+
await network.processAll()
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
afterAll(async () => {
|
|
54
|
+
await network.close()
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it(`[A] -> [B], A blocks B, viewed as C`, async () => {
|
|
58
|
+
const A = await sc.post(alice, `A`)
|
|
59
|
+
await network.processAll()
|
|
60
|
+
const B = await sc.reply(bob, A.ref, A.ref, `B`)
|
|
61
|
+
await network.processAll()
|
|
62
|
+
const block = await pdsAgent.api.app.bsky.graph.block.create(
|
|
63
|
+
{ repo: alice },
|
|
64
|
+
{ createdAt: new Date().toISOString(), subject: bob },
|
|
65
|
+
sc.getHeaders(alice),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
await network.processAll()
|
|
69
|
+
|
|
70
|
+
const timeline = await agent.api.app.bsky.feed.getTimeline(
|
|
71
|
+
{ limit: LIMIT },
|
|
72
|
+
{
|
|
73
|
+
headers: await network.serviceHeaders(
|
|
74
|
+
carol,
|
|
75
|
+
ids.AppBskyFeedGetTimeline,
|
|
76
|
+
),
|
|
77
|
+
},
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
const sliceA = timeline.data.feed.find((f) => f.post.uri === A.ref.uriStr)
|
|
81
|
+
const sliceB = timeline.data.feed.find((f) => f.post.uri === B.ref.uriStr)
|
|
82
|
+
|
|
83
|
+
expect(sliceA).toBeDefined()
|
|
84
|
+
expect(sliceB).toBeDefined()
|
|
85
|
+
|
|
86
|
+
if (!sliceA || !sliceB) {
|
|
87
|
+
throw new Error('sliceA or sliceB is undefined')
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
expect(AppBskyFeedDefs.isBlockedPost(sliceB.reply?.parent)).toBe(true)
|
|
91
|
+
expect(AppBskyFeedDefs.isBlockedPost(sliceB.reply?.root)).toBe(true)
|
|
92
|
+
|
|
93
|
+
await pdsAgent.api.app.bsky.graph.block.delete(
|
|
94
|
+
{ repo: alice, rkey: new AtUri(block.uri).rkey },
|
|
95
|
+
sc.getHeaders(alice),
|
|
96
|
+
)
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
it(`[A] -> [B] -> [C], A blocks B, viewed as C`, async () => {
|
|
100
|
+
const A = await sc.post(alice, `A`)
|
|
101
|
+
await network.processAll()
|
|
102
|
+
const B = await sc.reply(bob, A.ref, A.ref, `B`)
|
|
103
|
+
await network.processAll()
|
|
104
|
+
const C = await sc.reply(carol, A.ref, B.ref, `C`)
|
|
105
|
+
const block = await pdsAgent.api.app.bsky.graph.block.create(
|
|
106
|
+
{ repo: alice },
|
|
107
|
+
{ createdAt: new Date().toISOString(), subject: bob },
|
|
108
|
+
sc.getHeaders(alice),
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
await network.processAll()
|
|
112
|
+
|
|
113
|
+
const timeline = await agent.api.app.bsky.feed.getTimeline(
|
|
114
|
+
{ limit: LIMIT },
|
|
115
|
+
{
|
|
116
|
+
headers: await network.serviceHeaders(
|
|
117
|
+
carol,
|
|
118
|
+
ids.AppBskyFeedGetTimeline,
|
|
119
|
+
),
|
|
120
|
+
},
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
const sliceC = timeline.data.feed.find((f) => f.post.uri === C.ref.uriStr)
|
|
124
|
+
|
|
125
|
+
expect(sliceC).toBeDefined()
|
|
126
|
+
expect(sliceC?.reply).toBeDefined()
|
|
127
|
+
|
|
128
|
+
if (!sliceC || !sliceC.reply) {
|
|
129
|
+
throw new Error('sliceC is undefined')
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
expect(sliceC.reply.parent.uri).toEqual(B.ref.uriStr)
|
|
133
|
+
expect(sliceC.reply.root.uri).toEqual(A.ref.uriStr)
|
|
134
|
+
expect(AppBskyFeedDefs.isPostView(sliceC.reply.parent)).toBe(true)
|
|
135
|
+
expect(AppBskyFeedDefs.isBlockedPost(sliceC.reply.root)).toBe(true)
|
|
136
|
+
|
|
137
|
+
await pdsAgent.api.app.bsky.graph.block.delete(
|
|
138
|
+
{ repo: alice, rkey: new AtUri(block.uri).rkey },
|
|
139
|
+
sc.getHeaders(alice),
|
|
140
|
+
)
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
it(`[A] -> [B] -> [C], C blocks A, viewed as C`, async () => {
|
|
144
|
+
const A = await sc.post(alice, `A`)
|
|
145
|
+
await network.processAll()
|
|
146
|
+
const B = await sc.reply(bob, A.ref, A.ref, `B`)
|
|
147
|
+
await network.processAll()
|
|
148
|
+
const C = await sc.reply(carol, A.ref, B.ref, `C`)
|
|
149
|
+
const block = await pdsAgent.api.app.bsky.graph.block.create(
|
|
150
|
+
{ repo: carol },
|
|
151
|
+
{ createdAt: new Date().toISOString(), subject: alice },
|
|
152
|
+
sc.getHeaders(carol),
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
await network.processAll()
|
|
156
|
+
|
|
157
|
+
const timeline = await agent.api.app.bsky.feed.getTimeline(
|
|
158
|
+
// make sure we process all slices in this test
|
|
159
|
+
{ limit: LIMIT },
|
|
160
|
+
{
|
|
161
|
+
headers: await network.serviceHeaders(
|
|
162
|
+
carol,
|
|
163
|
+
ids.AppBskyFeedGetTimeline,
|
|
164
|
+
),
|
|
165
|
+
},
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
const sliceB = timeline.data.feed.find((f) => f.post.uri === B.ref.uriStr)
|
|
169
|
+
const sliceC = timeline.data.feed.find((f) => f.post.uri === C.ref.uriStr)
|
|
170
|
+
|
|
171
|
+
expect(sliceB).toBeUndefined()
|
|
172
|
+
expect(sliceC).toBeUndefined()
|
|
173
|
+
|
|
174
|
+
await pdsAgent.api.app.bsky.graph.block.delete(
|
|
175
|
+
{ repo: carol, rkey: new AtUri(block.uri).rkey },
|
|
176
|
+
sc.getHeaders(carol),
|
|
177
|
+
)
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
it(`[A] -> [B] -> [C], C blocks B, viewed as C`, async () => {
|
|
181
|
+
const A = await sc.post(alice, `A`)
|
|
182
|
+
await network.processAll()
|
|
183
|
+
const B = await sc.reply(bob, A.ref, A.ref, `B`)
|
|
184
|
+
await network.processAll()
|
|
185
|
+
const C = await sc.reply(carol, A.ref, B.ref, `C`)
|
|
186
|
+
const block = await pdsAgent.api.app.bsky.graph.block.create(
|
|
187
|
+
{ repo: carol },
|
|
188
|
+
{ createdAt: new Date().toISOString(), subject: bob },
|
|
189
|
+
sc.getHeaders(carol),
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
await network.processAll()
|
|
193
|
+
|
|
194
|
+
const timeline = await agent.api.app.bsky.feed.getTimeline(
|
|
195
|
+
// make sure we process all slices in this test
|
|
196
|
+
{ limit: LIMIT },
|
|
197
|
+
{
|
|
198
|
+
headers: await network.serviceHeaders(
|
|
199
|
+
carol,
|
|
200
|
+
ids.AppBskyFeedGetTimeline,
|
|
201
|
+
),
|
|
202
|
+
},
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
const sliceA = timeline.data.feed.find((f) => f.post.uri === A.ref.uriStr)
|
|
206
|
+
const sliceC = timeline.data.feed.find((f) => f.post.uri === C.ref.uriStr)
|
|
207
|
+
|
|
208
|
+
expect(sliceA).toBeDefined()
|
|
209
|
+
expect(sliceC).toBeUndefined()
|
|
210
|
+
|
|
211
|
+
await pdsAgent.api.app.bsky.graph.block.delete(
|
|
212
|
+
{ repo: carol, rkey: new AtUri(block.uri).rkey },
|
|
213
|
+
sc.getHeaders(carol),
|
|
214
|
+
)
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
it(`[A] -> [B] -> [C] -> [D], A blocks C, viewed as C`, async () => {
|
|
218
|
+
const A = await sc.post(alice, `A`)
|
|
219
|
+
await network.processAll()
|
|
220
|
+
const B = await sc.reply(bob, A.ref, A.ref, `B`)
|
|
221
|
+
await network.processAll()
|
|
222
|
+
const C = await sc.reply(carol, A.ref, B.ref, `C`)
|
|
223
|
+
await network.processAll()
|
|
224
|
+
const D = await sc.reply(dan, A.ref, C.ref, `D`)
|
|
225
|
+
const block = await pdsAgent.api.app.bsky.graph.block.create(
|
|
226
|
+
{ repo: alice },
|
|
227
|
+
{ createdAt: new Date().toISOString(), subject: carol },
|
|
228
|
+
sc.getHeaders(alice),
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
await network.processAll()
|
|
232
|
+
|
|
233
|
+
const timeline = await agent.api.app.bsky.feed.getTimeline(
|
|
234
|
+
{ limit: LIMIT },
|
|
235
|
+
{
|
|
236
|
+
headers: await network.serviceHeaders(
|
|
237
|
+
carol,
|
|
238
|
+
ids.AppBskyFeedGetTimeline,
|
|
239
|
+
),
|
|
240
|
+
},
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
const sliceD = timeline.data.feed.find((f) => f.post.uri === D.ref.uriStr)
|
|
244
|
+
|
|
245
|
+
expect(sliceD).toBeDefined()
|
|
246
|
+
expect(sliceD?.reply).toBeDefined()
|
|
247
|
+
|
|
248
|
+
if (!sliceD || !sliceD.reply) {
|
|
249
|
+
throw new Error('sliceD is undefined')
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
expect(sliceD.reply.parent.uri).toEqual(C.ref.uriStr)
|
|
253
|
+
expect(sliceD.reply.root.uri).toEqual(A.ref.uriStr)
|
|
254
|
+
expect(AppBskyFeedDefs.isPostView(sliceD.reply.parent)).toBe(true)
|
|
255
|
+
expect(AppBskyFeedDefs.isBlockedPost(sliceD.reply.root)).toBe(true)
|
|
256
|
+
|
|
257
|
+
await pdsAgent.api.app.bsky.graph.block.delete(
|
|
258
|
+
{ repo: alice, rkey: new AtUri(block.uri).rkey },
|
|
259
|
+
sc.getHeaders(alice),
|
|
260
|
+
)
|
|
261
|
+
})
|
|
262
|
+
|
|
263
|
+
it(`[A] -> [B] -> [C] -> [D], A blocks C, viewed as D`, async () => {
|
|
264
|
+
const A = await sc.post(alice, `A`)
|
|
265
|
+
await network.processAll()
|
|
266
|
+
const B = await sc.reply(bob, A.ref, A.ref, `B`)
|
|
267
|
+
await network.processAll()
|
|
268
|
+
const C = await sc.reply(carol, A.ref, B.ref, `C`)
|
|
269
|
+
await network.processAll()
|
|
270
|
+
const D = await sc.reply(dan, A.ref, C.ref, `D`)
|
|
271
|
+
const block = await pdsAgent.api.app.bsky.graph.block.create(
|
|
272
|
+
{ repo: alice },
|
|
273
|
+
{ createdAt: new Date().toISOString(), subject: carol },
|
|
274
|
+
sc.getHeaders(alice),
|
|
275
|
+
)
|
|
276
|
+
|
|
277
|
+
await network.processAll()
|
|
278
|
+
|
|
279
|
+
const timeline = await agent.api.app.bsky.feed.getTimeline(
|
|
280
|
+
{ limit: LIMIT },
|
|
281
|
+
{
|
|
282
|
+
headers: await network.serviceHeaders(dan, ids.AppBskyFeedGetTimeline),
|
|
283
|
+
},
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
const sliceD = timeline.data.feed.find((f) => f.post.uri === D.ref.uriStr)
|
|
287
|
+
|
|
288
|
+
expect(sliceD).toBeDefined()
|
|
289
|
+
expect(sliceD?.reply).toBeDefined()
|
|
290
|
+
|
|
291
|
+
if (!sliceD || !sliceD.reply) {
|
|
292
|
+
throw new Error('sliceD is undefined')
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
expect(sliceD.reply.parent.uri).toEqual(C.ref.uriStr)
|
|
296
|
+
expect(sliceD.reply.root.uri).toEqual(A.ref.uriStr)
|
|
297
|
+
expect(AppBskyFeedDefs.isPostView(sliceD.reply.parent)).toBe(true)
|
|
298
|
+
expect(AppBskyFeedDefs.isBlockedPost(sliceD.reply.root)).toBe(true)
|
|
299
|
+
|
|
300
|
+
await pdsAgent.api.app.bsky.graph.block.delete(
|
|
301
|
+
{ repo: alice, rkey: new AtUri(block.uri).rkey },
|
|
302
|
+
sc.getHeaders(alice),
|
|
303
|
+
)
|
|
304
|
+
})
|
|
305
|
+
|
|
306
|
+
it(`[A] -> [B] -> [C] -> [D], A blocks B, viewed as C`, async () => {
|
|
307
|
+
const A = await sc.post(alice, `A`)
|
|
308
|
+
await network.processAll()
|
|
309
|
+
const B = await sc.reply(bob, A.ref, A.ref, `B`)
|
|
310
|
+
await network.processAll()
|
|
311
|
+
const C = await sc.reply(carol, A.ref, B.ref, `C`)
|
|
312
|
+
await network.processAll()
|
|
313
|
+
const D = await sc.reply(dan, A.ref, C.ref, `D`)
|
|
314
|
+
const block = await pdsAgent.api.app.bsky.graph.block.create(
|
|
315
|
+
{ repo: alice },
|
|
316
|
+
{ createdAt: new Date().toISOString(), subject: bob },
|
|
317
|
+
sc.getHeaders(alice),
|
|
318
|
+
)
|
|
319
|
+
|
|
320
|
+
await network.processAll()
|
|
321
|
+
|
|
322
|
+
const timeline = await agent.api.app.bsky.feed.getTimeline(
|
|
323
|
+
{ limit: LIMIT },
|
|
324
|
+
{
|
|
325
|
+
headers: await network.serviceHeaders(
|
|
326
|
+
carol,
|
|
327
|
+
ids.AppBskyFeedGetTimeline,
|
|
328
|
+
),
|
|
329
|
+
},
|
|
330
|
+
)
|
|
331
|
+
|
|
332
|
+
const sliceD = timeline.data.feed.find((f) => f.post.uri === D.ref.uriStr)
|
|
333
|
+
|
|
334
|
+
expect(sliceD).toBeDefined()
|
|
335
|
+
expect(sliceD?.reply).toBeDefined()
|
|
336
|
+
|
|
337
|
+
if (!sliceD || !sliceD.reply) {
|
|
338
|
+
throw new Error('sliceD is undefined')
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
expect(sliceD.reply.parent.uri).toEqual(C.ref.uriStr)
|
|
342
|
+
expect(sliceD.reply.root.uri).toEqual(A.ref.uriStr)
|
|
343
|
+
expect(AppBskyFeedDefs.isPostView(sliceD.reply.parent)).toBe(true)
|
|
344
|
+
/*
|
|
345
|
+
* We don't walk the reply ancestors past whats available in the ReplyRef
|
|
346
|
+
*/
|
|
347
|
+
expect(AppBskyFeedDefs.isPostView(sliceD.reply.root)).toBe(true)
|
|
348
|
+
|
|
349
|
+
await pdsAgent.api.app.bsky.graph.block.delete(
|
|
350
|
+
{ repo: alice, rkey: new AtUri(block.uri).rkey },
|
|
351
|
+
sc.getHeaders(alice),
|
|
352
|
+
)
|
|
353
|
+
})
|
|
354
|
+
|
|
355
|
+
it(`[A] -> [B] -> [C] -> [D], B blocks C, viewed as D`, async () => {
|
|
356
|
+
const A = await sc.post(alice, `A`)
|
|
357
|
+
await network.processAll()
|
|
358
|
+
const B = await sc.reply(bob, A.ref, A.ref, `B`)
|
|
359
|
+
await network.processAll()
|
|
360
|
+
const C = await sc.reply(carol, A.ref, B.ref, `C`)
|
|
361
|
+
await network.processAll()
|
|
362
|
+
const D = await sc.reply(dan, A.ref, C.ref, `D`)
|
|
363
|
+
const block = await pdsAgent.api.app.bsky.graph.block.create(
|
|
364
|
+
{ repo: bob },
|
|
365
|
+
{ createdAt: new Date().toISOString(), subject: carol },
|
|
366
|
+
sc.getHeaders(bob),
|
|
367
|
+
)
|
|
368
|
+
|
|
369
|
+
await network.processAll()
|
|
370
|
+
|
|
371
|
+
const timeline = await agent.api.app.bsky.feed.getTimeline(
|
|
372
|
+
{ limit: LIMIT },
|
|
373
|
+
{
|
|
374
|
+
headers: await network.serviceHeaders(dan, ids.AppBskyFeedGetTimeline),
|
|
375
|
+
},
|
|
376
|
+
)
|
|
377
|
+
|
|
378
|
+
const sliceD = timeline.data.feed.find((f) => f.post.uri === D.ref.uriStr)
|
|
379
|
+
|
|
380
|
+
expect(sliceD).toBeDefined()
|
|
381
|
+
expect(sliceD?.reply).toBeDefined()
|
|
382
|
+
|
|
383
|
+
if (!sliceD || !sliceD.reply) {
|
|
384
|
+
throw new Error('sliceD is undefined')
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
expect(sliceD.reply.parent.uri).toEqual(C.ref.uriStr)
|
|
388
|
+
expect(sliceD.reply.root.uri).toEqual(A.ref.uriStr)
|
|
389
|
+
expect(AppBskyFeedDefs.isPostView(sliceD.reply.parent)).toBe(true)
|
|
390
|
+
/*
|
|
391
|
+
* We don't walk the reply ancestors past whats available in the ReplyRef
|
|
392
|
+
*/
|
|
393
|
+
expect(AppBskyFeedDefs.isPostView(sliceD.reply.root)).toBe(true)
|
|
394
|
+
|
|
395
|
+
await pdsAgent.api.app.bsky.graph.block.delete(
|
|
396
|
+
{ repo: bob, rkey: new AtUri(block.uri).rkey },
|
|
397
|
+
sc.getHeaders(bob),
|
|
398
|
+
)
|
|
399
|
+
})
|
|
400
|
+
|
|
401
|
+
it(`[A] -> [B] -> [C] -> [D], A blocks D, viewed as C`, async () => {
|
|
402
|
+
const A = await sc.post(alice, `A`)
|
|
403
|
+
await network.processAll()
|
|
404
|
+
const B = await sc.reply(bob, A.ref, A.ref, `B`)
|
|
405
|
+
await network.processAll()
|
|
406
|
+
const C = await sc.reply(carol, A.ref, B.ref, `C`)
|
|
407
|
+
await network.processAll()
|
|
408
|
+
const D = await sc.reply(dan, A.ref, C.ref, `D`)
|
|
409
|
+
const block = await pdsAgent.api.app.bsky.graph.block.create(
|
|
410
|
+
{ repo: alice },
|
|
411
|
+
{ createdAt: new Date().toISOString(), subject: dan },
|
|
412
|
+
sc.getHeaders(alice),
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
await network.processAll()
|
|
416
|
+
|
|
417
|
+
const timeline = await agent.api.app.bsky.feed.getTimeline(
|
|
418
|
+
{ limit: LIMIT },
|
|
419
|
+
{
|
|
420
|
+
headers: await network.serviceHeaders(
|
|
421
|
+
carol,
|
|
422
|
+
ids.AppBskyFeedGetTimeline,
|
|
423
|
+
),
|
|
424
|
+
},
|
|
425
|
+
)
|
|
426
|
+
|
|
427
|
+
const sliceD = timeline.data.feed.find((f) => f.post.uri === D.ref.uriStr)
|
|
428
|
+
const sliceC = timeline.data.feed.find((f) => f.post.uri === C.ref.uriStr)
|
|
429
|
+
|
|
430
|
+
expect(sliceD).toBeDefined()
|
|
431
|
+
expect(sliceC).toBeDefined()
|
|
432
|
+
|
|
433
|
+
if (!sliceD || !sliceC) {
|
|
434
|
+
throw new Error('sliceD or sliceC is undefined')
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
expect(AppBskyFeedDefs.isBlockedPost(sliceD.reply?.root)).toBe(true)
|
|
438
|
+
expect(AppBskyFeedDefs.isPostView(sliceC.reply?.parent)).toBe(true)
|
|
439
|
+
expect(AppBskyFeedDefs.isPostView(sliceC.reply?.root)).toBe(true)
|
|
440
|
+
|
|
441
|
+
await pdsAgent.api.app.bsky.graph.block.delete(
|
|
442
|
+
{ repo: alice, rkey: new AtUri(block.uri).rkey },
|
|
443
|
+
sc.getHeaders(alice),
|
|
444
|
+
)
|
|
445
|
+
})
|
|
446
|
+
|
|
447
|
+
it(`[A] -> [B] -> [C] -> [D], A blocks C, viewed as D, A/B/C are outside first page`, async () => {
|
|
448
|
+
const A = await sc.post(alice, `A`)
|
|
449
|
+
await network.processAll()
|
|
450
|
+
const B = await sc.reply(bob, A.ref, A.ref, `B`)
|
|
451
|
+
await network.processAll()
|
|
452
|
+
const C = await sc.reply(carol, A.ref, B.ref, `C`)
|
|
453
|
+
await network.processAll()
|
|
454
|
+
|
|
455
|
+
// push A/B/C to send page of results
|
|
456
|
+
await sc.post(alice, `Aa`)
|
|
457
|
+
await sc.post(alice, `Ab`)
|
|
458
|
+
await sc.post(alice, `Ac`)
|
|
459
|
+
await sc.post(alice, `Ad`)
|
|
460
|
+
|
|
461
|
+
await network.processAll()
|
|
462
|
+
|
|
463
|
+
const D = await sc.reply(dan, A.ref, C.ref, `D`)
|
|
464
|
+
const block = await pdsAgent.api.app.bsky.graph.block.create(
|
|
465
|
+
{ repo: alice },
|
|
466
|
+
{ createdAt: new Date().toISOString(), subject: carol },
|
|
467
|
+
sc.getHeaders(alice),
|
|
468
|
+
)
|
|
469
|
+
|
|
470
|
+
await network.processAll()
|
|
471
|
+
|
|
472
|
+
const timeline = await agent.api.app.bsky.feed.getTimeline(
|
|
473
|
+
{ limit: LIMIT },
|
|
474
|
+
{
|
|
475
|
+
headers: await network.serviceHeaders(dan, ids.AppBskyFeedGetTimeline),
|
|
476
|
+
},
|
|
477
|
+
)
|
|
478
|
+
|
|
479
|
+
const sliceD = timeline.data.feed.find((f) => f.post.uri === D.ref.uriStr)
|
|
480
|
+
const sliceA = timeline.data.feed.find((f) => f.post.uri === A.ref.uriStr)
|
|
481
|
+
|
|
482
|
+
expect(sliceD).toBeDefined()
|
|
483
|
+
expect(sliceD?.reply).toBeDefined()
|
|
484
|
+
// not in first page of results
|
|
485
|
+
expect(sliceA).toBeUndefined()
|
|
486
|
+
|
|
487
|
+
if (!sliceD || !sliceD.reply) {
|
|
488
|
+
throw new Error('sliceD is undefined')
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
expect(sliceD.reply.parent.uri).toEqual(C.ref.uriStr)
|
|
492
|
+
expect(sliceD.reply.root.uri).toEqual(A.ref.uriStr)
|
|
493
|
+
expect(AppBskyFeedDefs.isPostView(sliceD.reply.parent)).toBe(true)
|
|
494
|
+
expect(AppBskyFeedDefs.isBlockedPost(sliceD.reply.root)).toBe(true)
|
|
495
|
+
|
|
496
|
+
await pdsAgent.api.app.bsky.graph.block.delete(
|
|
497
|
+
{ repo: alice, rkey: new AtUri(block.uri).rkey },
|
|
498
|
+
sc.getHeaders(alice),
|
|
499
|
+
)
|
|
500
|
+
})
|
|
501
|
+
})
|
|
@@ -175,4 +175,16 @@ describe('list feed views', () => {
|
|
|
175
175
|
recordUri: postRef.uriStr,
|
|
176
176
|
})
|
|
177
177
|
})
|
|
178
|
+
|
|
179
|
+
it('does not return posts with creator blocks', async () => {
|
|
180
|
+
await sc.block(bob, alice)
|
|
181
|
+
await network.processAll()
|
|
182
|
+
|
|
183
|
+
const res = await agent.api.app.bsky.feed.getListFeed({
|
|
184
|
+
list: listRef.uriStr,
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
const hasBob = res.data.feed.some((item) => item.post.author.did === bob)
|
|
188
|
+
expect(hasBob).toBe(false)
|
|
189
|
+
})
|
|
178
190
|
})
|
|
@@ -8,7 +8,9 @@ describe('bsky actor likes feed views', () => {
|
|
|
8
8
|
let agent: AtpAgent
|
|
9
9
|
let sc: SeedClient
|
|
10
10
|
|
|
11
|
+
let curateList: string
|
|
11
12
|
let referenceList: string
|
|
13
|
+
let alice: string
|
|
12
14
|
let eve: string
|
|
13
15
|
let frankie: string
|
|
14
16
|
let greta: string
|
|
@@ -35,17 +37,32 @@ describe('bsky actor likes feed views', () => {
|
|
|
35
37
|
email: 'greta@greta.com',
|
|
36
38
|
password: 'hunter4real',
|
|
37
39
|
})
|
|
38
|
-
|
|
40
|
+
|
|
41
|
+
const newRefList = await sc.createList(
|
|
39
42
|
sc.dids.eve,
|
|
40
43
|
'blah starter pack list!',
|
|
41
44
|
'reference',
|
|
42
45
|
)
|
|
43
|
-
await sc.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
const newCurrList = await sc.createList(
|
|
47
|
+
sc.dids.eve,
|
|
48
|
+
'blah curate list!',
|
|
49
|
+
'curate',
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
await sc.addToList(sc.dids.eve, sc.dids.eve, newRefList)
|
|
53
|
+
await sc.addToList(sc.dids.eve, sc.dids.bob, newRefList)
|
|
54
|
+
await sc.addToList(sc.dids.eve, sc.dids.frankie, newRefList)
|
|
55
|
+
|
|
56
|
+
await sc.addToList(sc.dids.eve, sc.dids.eve, newCurrList)
|
|
57
|
+
await sc.addToList(sc.dids.eve, sc.dids.bob, newCurrList)
|
|
58
|
+
await sc.addToList(sc.dids.eve, sc.dids.frankie, newCurrList)
|
|
59
|
+
|
|
46
60
|
await sc.block(sc.dids.frankie, sc.dids.eve)
|
|
61
|
+
|
|
47
62
|
await network.processAll()
|
|
48
|
-
|
|
63
|
+
curateList = newCurrList.uriStr
|
|
64
|
+
referenceList = newRefList.uriStr
|
|
65
|
+
alice = sc.dids.alice
|
|
49
66
|
eve = sc.dids.eve
|
|
50
67
|
frankie = sc.dids.frankie
|
|
51
68
|
greta = sc.dids.greta
|
|
@@ -61,44 +78,92 @@ describe('bsky actor likes feed views', () => {
|
|
|
61
78
|
const view = await agent.api.app.bsky.graph.getLists({
|
|
62
79
|
actor: eve,
|
|
63
80
|
})
|
|
64
|
-
expect(view.data.lists.length).toBe(
|
|
81
|
+
expect(view.data.lists.length).toBe(2)
|
|
65
82
|
expect(forSnapshot(view.data.lists)).toMatchSnapshot()
|
|
66
83
|
})
|
|
67
84
|
|
|
68
85
|
it('does not include users with creator block relationship in reference lists for non-creator, in-list viewers', async () => {
|
|
69
|
-
const
|
|
86
|
+
const curView = await agent.api.app.bsky.graph.getList(
|
|
87
|
+
{
|
|
88
|
+
list: curateList,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
headers: await network.serviceHeaders(frankie, ids.AppBskyGraphGetList),
|
|
92
|
+
},
|
|
93
|
+
)
|
|
94
|
+
expect(curView.data.items.length).toBe(2)
|
|
95
|
+
expect(forSnapshot(curView.data.items)).toMatchSnapshot()
|
|
96
|
+
|
|
97
|
+
const refView = await agent.api.app.bsky.graph.getList(
|
|
70
98
|
{ list: referenceList },
|
|
71
99
|
{
|
|
72
100
|
headers: await network.serviceHeaders(frankie, ids.AppBskyGraphGetList),
|
|
73
101
|
},
|
|
74
102
|
)
|
|
75
|
-
expect(
|
|
76
|
-
expect(forSnapshot(
|
|
103
|
+
expect(refView.data.items.length).toBe(2)
|
|
104
|
+
expect(forSnapshot(refView.data.items)).toMatchSnapshot()
|
|
77
105
|
})
|
|
78
106
|
|
|
79
107
|
it('does not include users with creator block relationship in reference lists for non-creator, not-in-list viewers', async () => {
|
|
80
|
-
const
|
|
108
|
+
const curView = await agent.api.app.bsky.graph.getList(
|
|
109
|
+
{
|
|
110
|
+
list: curateList,
|
|
111
|
+
},
|
|
112
|
+
{ headers: await network.serviceHeaders(greta, ids.AppBskyGraphGetList) },
|
|
113
|
+
)
|
|
114
|
+
expect(curView.data.items.length).toBe(2)
|
|
115
|
+
expect(forSnapshot(curView.data.items)).toMatchSnapshot()
|
|
116
|
+
|
|
117
|
+
const refView = await agent.api.app.bsky.graph.getList(
|
|
81
118
|
{ list: referenceList },
|
|
82
119
|
{ headers: await network.serviceHeaders(greta, ids.AppBskyGraphGetList) },
|
|
83
120
|
)
|
|
84
|
-
expect(
|
|
85
|
-
expect(forSnapshot(
|
|
121
|
+
expect(refView.data.items.length).toBe(2)
|
|
122
|
+
expect(forSnapshot(refView.data.items)).toMatchSnapshot()
|
|
86
123
|
})
|
|
87
124
|
|
|
88
|
-
it('does not include users with creator block relationship in reference lists for signed-out viewers', async () => {
|
|
89
|
-
const
|
|
125
|
+
it('does not include users with creator block relationship in reference and curate lists for signed-out viewers', async () => {
|
|
126
|
+
const curView = await agent.api.app.bsky.graph.getList({
|
|
127
|
+
list: curateList,
|
|
128
|
+
})
|
|
129
|
+
expect(curView.data.items.length).toBe(2)
|
|
130
|
+
expect(forSnapshot(curView.data.items)).toMatchSnapshot()
|
|
131
|
+
|
|
132
|
+
const refView = await agent.api.app.bsky.graph.getList({
|
|
90
133
|
list: referenceList,
|
|
91
134
|
})
|
|
92
|
-
expect(
|
|
93
|
-
expect(forSnapshot(
|
|
135
|
+
expect(refView.data.items.length).toBe(2)
|
|
136
|
+
expect(forSnapshot(refView.data.items)).toMatchSnapshot()
|
|
94
137
|
})
|
|
95
138
|
|
|
96
139
|
it('does include users with creator block relationship in reference lists for creator', async () => {
|
|
97
|
-
const
|
|
140
|
+
const curView = await agent.api.app.bsky.graph.getList(
|
|
141
|
+
{ list: curateList },
|
|
142
|
+
{ headers: await network.serviceHeaders(eve, ids.AppBskyGraphGetList) },
|
|
143
|
+
)
|
|
144
|
+
expect(curView.data.items.length).toBe(3)
|
|
145
|
+
expect(forSnapshot(curView.data.items)).toMatchSnapshot()
|
|
146
|
+
|
|
147
|
+
const refView = await agent.api.app.bsky.graph.getList(
|
|
98
148
|
{ list: referenceList },
|
|
99
149
|
{ headers: await network.serviceHeaders(eve, ids.AppBskyGraphGetList) },
|
|
100
150
|
)
|
|
101
|
-
expect(
|
|
151
|
+
expect(refView.data.items.length).toBe(3)
|
|
152
|
+
expect(forSnapshot(refView.data.items)).toMatchSnapshot()
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
it('does return all users regardless of creator block relationship in moderation lists', async () => {
|
|
156
|
+
const blockList = await sc.createList(eve, 'block list', 'mod')
|
|
157
|
+
await sc.addToList(eve, frankie, blockList)
|
|
158
|
+
await sc.addToList(eve, greta, blockList)
|
|
159
|
+
await sc.block(frankie, greta)
|
|
160
|
+
await network.processAll()
|
|
161
|
+
|
|
162
|
+
const view = await agent.api.app.bsky.graph.getList(
|
|
163
|
+
{ list: blockList.uriStr },
|
|
164
|
+
{ headers: await network.serviceHeaders(alice, ids.AppBskyGraphGetList) },
|
|
165
|
+
)
|
|
166
|
+
expect(view.data.items.length).toBe(2)
|
|
102
167
|
expect(forSnapshot(view.data.items)).toMatchSnapshot()
|
|
103
168
|
})
|
|
104
169
|
})
|