[READ ONLY MIRROR] Spark Social AppView Server github.com/sprksocial/server
atproto deno hono lexicon
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

coming up next: am i the stupidest person alive?

+8 -15
-1
api/so/sprk/actor/getProfiles.ts
··· 42 42 params: Params; 43 43 }): Promise<SkeletonState> => { 44 44 const { ctx, params } = input; 45 - console.log("actor params:", params.actors, typeof params.actors); 46 45 const dids = await ctx.hydrator.actor.getDidsDefined(params.actors); 47 46 return { dids }; 48 47 };
+1
api/so/sprk/graph/getFollowers.ts
··· 74 74 const { followUris, subjectDid } = skeleton; 75 75 const followState = await ctx.hydrator.hydrateFollows( 76 76 followUris, 77 + params.hydrateCtx, 77 78 ); 78 79 const dids = [subjectDid]; 79 80 if (followState.follows) {
+1 -1
api/so/sprk/graph/getFollows.ts
··· 74 74 const { followUris, subjectDid } = skeleton; 75 75 const followState = await ctx.hydrator.hydrateFollows( 76 76 followUris, 77 + params.hydrateCtx, 77 78 ); 78 79 const dids = [subjectDid]; 79 80 if (followState.follows) { ··· 87 88 dids, 88 89 params.hydrateCtx, 89 90 ); 90 - console.log(profileState); 91 91 return mergeStates(followState, profileState); 92 92 }; 93 93
+2 -2
data-plane/routes/records.ts
··· 113 113 } 114 114 115 115 async getBlockRecords(uris: string[]) { 116 - const result = await getRecords(this.db, uris, ids.AppBskyGraphBlock); 116 + const result = await getRecords(this.db, uris, ids.SoSprkGraphBlock); 117 117 return result; 118 118 } 119 119 ··· 128 128 } 129 129 130 130 async getFollowRecords(uris: string[]) { 131 - const result = await getRecords(this.db, uris, ids.AppBskyGraphFollow); 131 + const result = await getRecords(this.db, uris, ids.SoSprkGraphFollow); 132 132 return result; 133 133 } 134 134
+4 -3
hydration/index.ts
··· 609 609 // provides partial hydration state within getFollows / getFollowers, mainly for applying rules 610 610 async hydrateFollows( 611 611 uris: string[], 612 + ctx: HydrateCtx, 612 613 ): Promise<HydrationState> { 613 - const follows = await this.graph.getFollows(uris); 614 + const follows = await this.graph.getFollows(uris, ctx.includeTakedowns); 614 615 const pairs: RelationshipPair[] = []; 615 616 for (const [uri, follow] of follows) { 616 617 if (follow) { ··· 699 700 (await this.feed.getSounds([uri], includeTakedowns)).get(uri) ?? 700 701 undefined 701 702 ); 702 - } else if (collection === ids.AppBskyGraphFollow) { 703 + } else if (collection === ids.SoSprkGraphFollow) { 703 704 return ( 704 705 (await this.graph.getFollows([uri], includeTakedowns)).get(uri) ?? 705 706 undefined 706 707 ); 707 - } else if (collection === ids.AppBskyGraphBlock) { 708 + } else if (collection === ids.SoSprkGraphBlock) { 708 709 return ( 709 710 (await this.graph.getBlocks([uri], includeTakedowns)).get(uri) ?? 710 711 undefined
-8
tests/main_test.ts
··· 62 62 } 63 63 64 64 Deno.test("Basic App Creation", async () => { 65 - console.log("Testing basic app creation..."); 66 - 67 65 const ctx = createMockContext(); 68 66 const app = createApp(ctx); 69 - 70 - console.log("App created successfully"); 71 67 72 68 const res = await app.request("/", { 73 69 headers: { ··· 76 72 }); 77 73 78 74 assertEquals(res.status, 200); 79 - console.log("Basic app test passed"); 80 75 }); 81 76 82 77 Deno.test("Well Known Endpoint", async () => { 83 - console.log("Testing well-known endpoint..."); 84 - 85 78 const ctx = createMockContext(); 86 79 const app = createApp(ctx); 87 80 ··· 113 106 ].join(""), 114 107 ), 115 108 ); 116 - console.log("Well-known endpoint test passed"); 117 109 });