See the best posts from any Bluesky account
0
fork

Configure Feed

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

Apply prettier auto-fixes across pre-existing files

Side-effect of running `pnpm lint --fix` while landing Phase 3 of the
firehose virality webhook. These files had prettier violations that
predate this work; no logic changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+140 -70
+1 -2
app/controllers/landing_controller.ts
··· 11 11 .orderByRaw('RANDOM()') 12 12 .limit(3) 13 13 14 - const examples = 15 - featured.length > 0 ? featured.map((p) => p.handle) : FALLBACK_HANDLES 14 + const examples = featured.length > 0 ? featured.map((p) => p.handle) : FALLBACK_HANDLES 16 15 17 16 return view.render('pages/landing', { 18 17 examples,
+1 -2
app/exceptions/handler.ts
··· 27 27 }, 28 28 ...(app.inProduction 29 29 ? { 30 - '500..599': (error, { view }) => 31 - view.render('pages/errors/server_error', { error }), 30 + '500..599': (error, { view }) => view.render('pages/errors/server_error', { error }), 32 31 } 33 32 : {}), 34 33 }
+9 -4
app/lib/og/renderer.ts
··· 19 19 // Fonts (loaded once, lazily) 20 20 // --------------------------------------------------------------------------- 21 21 22 - let fontsLoaded: { name: string; data: ArrayBuffer; weight: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900; style: 'normal' }[] | null = null 22 + let fontsLoaded: 23 + | { 24 + name: string 25 + data: ArrayBuffer 26 + weight: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 27 + style: 'normal' 28 + }[] 29 + | null = null 23 30 24 31 function getFonts() { 25 32 if (fontsLoaded) return fontsLoaded ··· 183 190 handle: string 184 191 displayName?: string | null 185 192 }): Promise<Buffer> { 186 - const title = opts.displayName 187 - ? `${opts.displayName}'s top posts` 188 - : `@${opts.handle}'s top posts` 193 + const title = opts.displayName ? `${opts.displayName}'s top posts` : `@${opts.handle}'s top posts` 189 194 190 195 const markup = wrapLayout([ 191 196 logoElement(44),
+3 -1
commands/backfill_unstick.ts
··· 37 37 this.logger.info(`Would unstick ${stalled.length} job(s):`) 38 38 for (const row of stalled) { 39 39 const stalledFor = Math.round((Date.now() - row.startedAt) / 60_000) 40 - this.logger.info(` ${row.did} — stalled ~${stalledFor}m, fetched ${row.fetchedPosts} posts`) 40 + this.logger.info( 41 + ` ${row.did} — stalled ~${stalledFor}m, fetched ${row.fetchedPosts} posts` 42 + ) 41 43 } 42 44 return 43 45 }
+4 -1
commands/jetstream_consume.ts
··· 53 53 54 54 // Read tracked DIDs → handles from SQLite tracked_profiles table (exclude soft-deleted profiles) 55 55 readTrackedDids: async () => { 56 - const rows = await db.from('tracked_profiles').whereNull('deleted_at').select('did', 'handle') 56 + const rows = await db 57 + .from('tracked_profiles') 58 + .whereNull('deleted_at') 59 + .select('did', 'handle') 57 60 return new Map<string, string>( 58 61 rows.map((r: { did: string; handle: string }) => [r.did, r.handle]) 59 62 )
+3 -3
commands/seed_top_accounts.ts
··· 100 100 headers: { 101 101 'User-Agent': 102 102 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:149.0) Gecko/20100101 Firefox/149.0', 103 - Accept: 'text/event-stream', 104 - Origin: 'https://bluecrawler.com', 105 - Referer: 'https://bluecrawler.com/', 103 + 'Accept': 'text/event-stream', 104 + 'Origin': 'https://bluecrawler.com', 105 + 'Referer': 'https://bluecrawler.com/', 106 106 'Sec-Fetch-Site': 'same-site', 107 107 }, 108 108 signal: controller.signal,
+3 -12
start/routes.ts
··· 66 66 .get('/oauth/client-metadata.json', [OAuthController, 'clientMetadata']) 67 67 .as('oauth.clientMetadata') 68 68 69 - router 70 - .get('/oauth/login', [OAuthController, 'login']) 71 - .use(middleware.guest()) 72 - .as('oauth.login') 69 + router.get('/oauth/login', [OAuthController, 'login']).use(middleware.guest()).as('oauth.login') 73 70 74 - router 75 - .get('/oauth/callback', [OAuthController, 'callback']) 76 - .as('oauth.callback') 71 + router.get('/oauth/callback', [OAuthController, 'callback']).as('oauth.callback') 77 72 78 - router 79 - .post('/oauth/logout', [OAuthController, 'logout']) 80 - .use(middleware.auth()) 81 - .as('oauth.logout') 73 + router.post('/oauth/logout', [OAuthController, 'logout']).use(middleware.auth()).as('oauth.logout') 82 74 83 75 // --------------------------------------------------------------------------- 84 76 // Engagement API (like / repost) ··· 138 130 return response.unauthorized({ message: 'Unauthorized' }) 139 131 }) 140 132 .as('health.ready') 141 -
+1 -5
tests/browser/dark_mode.spec.ts
··· 164 164 await store.client.command({ query: 'TRUNCATE TABLE engagement_events' }) 165 165 }) 166 166 167 - test('dark mode survives navigating between profile tabs', async ({ 168 - visit, 169 - assert, 170 - swap, 171 - }) => { 167 + test('dark mode survives navigating between profile tabs', async ({ visit, assert, swap }) => { 172 168 // Wire up test dependencies 173 169 swap(ClickHouseStore, store) 174 170 swap(AtprotoClient, makeFakeAtprotoClient())
+4 -1
tests/functional/oauth.spec.ts
··· 71 71 // behaves the same as nonexistent — both hit the authorize path and flash 72 72 // an error because the handle doesn't resolve) 73 73 const withAt = await client.get('/oauth/login').qs({ handle: '@test.bsky.social' }).redirects(0) 74 - const withoutAt = await client.get('/oauth/login').qs({ handle: 'test.bsky.social' }).redirects(0) 74 + const withoutAt = await client 75 + .get('/oauth/login') 76 + .qs({ handle: 'test.bsky.social' }) 77 + .redirects(0) 75 78 // Both should behave identically (redirect to auth server, or flash error) 76 79 withAt.assertStatus(withoutAt.response.status) 77 80 })
+38 -14
tests/functional/profile_controller.spec.ts
··· 96 96 // Test 1b: Landing page shows random featured profiles 97 97 test('GET / shows featured tracked profiles as examples', async ({ client, assert }) => { 98 98 await TrackedProfile.createMany([ 99 - { did: 'did:plc:aaa', handle: 'featured1.bsky.social', isFeatured: true, firstSeenAt: Date.now() }, 100 - { did: 'did:plc:bbb', handle: 'featured2.bsky.social', isFeatured: true, firstSeenAt: Date.now() }, 101 - { did: 'did:plc:ccc', handle: 'featured3.bsky.social', isFeatured: true, firstSeenAt: Date.now() }, 102 - { did: 'did:plc:ddd', handle: 'featured4.bsky.social', isFeatured: true, firstSeenAt: Date.now() }, 103 - { did: 'did:plc:eee', handle: 'notfeatured.bsky.social', isFeatured: false, firstSeenAt: Date.now() }, 99 + { 100 + did: 'did:plc:aaa', 101 + handle: 'featured1.bsky.social', 102 + isFeatured: true, 103 + firstSeenAt: Date.now(), 104 + }, 105 + { 106 + did: 'did:plc:bbb', 107 + handle: 'featured2.bsky.social', 108 + isFeatured: true, 109 + firstSeenAt: Date.now(), 110 + }, 111 + { 112 + did: 'did:plc:ccc', 113 + handle: 'featured3.bsky.social', 114 + isFeatured: true, 115 + firstSeenAt: Date.now(), 116 + }, 117 + { 118 + did: 'did:plc:ddd', 119 + handle: 'featured4.bsky.social', 120 + isFeatured: true, 121 + firstSeenAt: Date.now(), 122 + }, 123 + { 124 + did: 'did:plc:eee', 125 + handle: 'notfeatured.bsky.social', 126 + isFeatured: false, 127 + firstSeenAt: Date.now(), 128 + }, 104 129 ]) 105 130 106 131 const response = await client.get('/') ··· 111 136 assert.notInclude(body, 'notfeatured.bsky.social') 112 137 113 138 // Exactly 3 of the 4 featured profiles should appear 114 - const featured = ['featured1.bsky.social', 'featured2.bsky.social', 'featured3.bsky.social', 'featured4.bsky.social'] 139 + const featured = [ 140 + 'featured1.bsky.social', 141 + 'featured2.bsky.social', 142 + 'featured3.bsky.social', 143 + 'featured4.bsky.social', 144 + ] 115 145 const found = featured.filter((h) => body.includes(h)) 116 146 assert.equal(found.length, 3) 117 147 }) ··· 476 506 477 507 const response = await client.get('/profile/dril.bsky.social/likes?days=30') 478 508 response.assertStatus(200) 479 - assert.include( 480 - response.text(), 481 - '<link rel="canonical"' 482 - ) 483 - assert.match( 484 - response.text(), 485 - /href="[^"]*\/profile\/dril\.bsky\.social\/likes\?days=30"/ 486 - ) 509 + assert.include(response.text(), '<link rel="canonical"') 510 + assert.match(response.text(), /href="[^"]*\/profile\/dril\.bsky\.social\/likes\?days=30"/) 487 511 }).skip(async () => !(await isClickHouseAvailable()), 'ClickHouse not available') 488 512 489 513 // Test 13: /reposts shows reposts kind toggle active
+1 -3
tests/unit/alpine/search_ahead.spec.ts
··· 87 87 88 88 test('Enter selects the active actor', ({ assert }) => { 89 89 const { component, navigations } = setup() 90 - component.actors = [ 91 - { handle: 'a.bsky.social', displayName: 'A', avatar: null }, 92 - ] 90 + component.actors = [{ handle: 'a.bsky.social', displayName: 'A', avatar: null }] 93 91 component.open = true 94 92 component.activeIndex = 0 95 93
+1 -5
tests/unit/atproto_oauth_storage.spec.ts
··· 1 1 import { test } from '@japa/runner' 2 2 import testUtils from '@adonisjs/core/services/test_utils' 3 3 import Account from '#models/account' 4 - import { 5 - createStateStore, 6 - createSessionStore, 7 - buildClientMetadata, 8 - } from '#services/atproto_oauth' 4 + import { createStateStore, createSessionStore, buildClientMetadata } from '#services/atproto_oauth' 9 5 10 6 test.group('AtprotoOAuth — state store', (group) => { 11 7 group.each.setup(() => testUtils.db().withGlobalTransaction())
+6 -1
tests/unit/bluecrawler.spec.ts
··· 79 79 JSON.stringify({ 80 80 genTime: '2026-04-13T07:15:44.873Z', 81 81 rankings: [ 82 - { did: 'did:plc:abc123', handle: 'alice.bsky.social', displayName: 'Alice', followersCount: 500000 }, 82 + { 83 + did: 'did:plc:abc123', 84 + handle: 'alice.bsky.social', 85 + displayName: 'Alice', 86 + followersCount: 500000, 87 + }, 83 88 { handle: 'missing-did.bsky.social', displayName: 'No DID', followersCount: 1000 }, 84 89 { did: 'did:plc:no-handle', displayName: 'No Handle', followersCount: 1000 }, 85 90 ],
+21 -7
tests/unit/commands/backfill_unstick.spec.ts
··· 28 28 test.group('unstickBackfillJobs — identifies stalled jobs', (group) => { 29 29 group.each.setup(() => testUtils.db().withGlobalTransaction()) 30 30 31 - test('resets jobs that are running with a lock token older than threshold', async ({ assert }) => { 31 + test('resets jobs that are running with a lock token older than threshold', async ({ 32 + assert, 33 + }) => { 32 34 await seedProfile(DID_STALLED) 33 35 await BackfillJobRow.create({ 34 36 did: DID_STALLED, ··· 41 43 const dispatched: string[] = [] 42 44 const result = await unstickBackfillJobs({ 43 45 staleMinutes: 30, 44 - dispatch: async (did) => { dispatched.push(did) }, 46 + dispatch: async (did) => { 47 + dispatched.push(did) 48 + }, 45 49 }) 46 50 47 51 assert.equal(result.unstuck, 1) ··· 67 71 const dispatched: string[] = [] 68 72 const result = await unstickBackfillJobs({ 69 73 staleMinutes: 30, 70 - dispatch: async (did) => { dispatched.push(did) }, 74 + dispatch: async (did) => { 75 + dispatched.push(did) 76 + }, 71 77 }) 72 78 73 79 assert.equal(result.unstuck, 0) ··· 101 107 const dispatched: string[] = [] 102 108 const result = await unstickBackfillJobs({ 103 109 staleMinutes: 30, 104 - dispatch: async (did) => { dispatched.push(did) }, 110 + dispatch: async (did) => { 111 + dispatched.push(did) 112 + }, 105 113 }) 106 114 107 115 assert.equal(result.unstuck, 0) ··· 121 129 const dispatched: string[] = [] 122 130 const result = await unstickBackfillJobs({ 123 131 staleMinutes: 30, 124 - dispatch: async (did) => { dispatched.push(did) }, 132 + dispatch: async (did) => { 133 + dispatched.push(did) 134 + }, 125 135 }) 126 136 127 137 assert.equal(result.unstuck, 0) ··· 145 155 const dispatched: string[] = [] 146 156 const result = await unstickBackfillJobs({ 147 157 staleMinutes: 30, 148 - dispatch: async (did) => { dispatched.push(did) }, 158 + dispatch: async (did) => { 159 + dispatched.push(did) 160 + }, 149 161 }) 150 162 151 163 assert.equal(result.unstuck, 2) ··· 167 179 168 180 // Should NOT be unstuck with default (60 min) 169 181 const result = await unstickBackfillJobs({ 170 - dispatch: async (did) => { dispatched.push(did) }, 182 + dispatch: async (did) => { 183 + dispatched.push(did) 184 + }, 171 185 }) 172 186 173 187 assert.equal(result.unstuck, 0)
+40 -8
tests/unit/jobs/backfill_job.spec.ts
··· 142 142 143 143 test('inserts snapshots, sets backfilledAt, marks job done', async ({ assert }) => { 144 144 // Seed SQLite rows 145 - await TrackedProfile.create({ did: TEST_DID, handle: 'test.bsky.social', firstSeenAt: Date.now() }) 145 + await TrackedProfile.create({ 146 + did: TEST_DID, 147 + handle: 'test.bsky.social', 148 + firstSeenAt: Date.now(), 149 + }) 146 150 await BackfillJobRow.create({ 147 151 did: TEST_DID, 148 152 startedAt: Date.now(), ··· 190 194 test('calls getAuthorFeed twice, never calls getPosts, final fetchedPosts is 200', async ({ 191 195 assert, 192 196 }) => { 193 - await TrackedProfile.create({ did: TEST_DID, handle: 'test.bsky.social', firstSeenAt: Date.now() }) 197 + await TrackedProfile.create({ 198 + did: TEST_DID, 199 + handle: 'test.bsky.social', 200 + firstSeenAt: Date.now(), 201 + }) 194 202 await BackfillJobRow.create({ 195 203 did: TEST_DID, 196 204 startedAt: Date.now(), ··· 250 258 group.each.setup(() => testUtils.db().withGlobalTransaction()) 251 259 252 260 test('stops after max posts, does not fetch more pages', async ({ assert }) => { 253 - await TrackedProfile.create({ did: TEST_DID, handle: 'test.bsky.social', firstSeenAt: Date.now() }) 261 + await TrackedProfile.create({ 262 + did: TEST_DID, 263 + handle: 'test.bsky.social', 264 + firstSeenAt: Date.now(), 265 + }) 254 266 await BackfillJobRow.create({ 255 267 did: TEST_DID, 256 268 startedAt: Date.now(), ··· 310 322 group.each.setup(() => testUtils.db().withGlobalTransaction()) 311 323 312 324 test('no insertPostSnapshots call, backfilledAt still set, state done', async ({ assert }) => { 313 - await TrackedProfile.create({ did: TEST_DID, handle: 'test.bsky.social', firstSeenAt: Date.now() }) 325 + await TrackedProfile.create({ 326 + did: TEST_DID, 327 + handle: 'test.bsky.social', 328 + firstSeenAt: Date.now(), 329 + }) 314 330 await BackfillJobRow.create({ 315 331 did: TEST_DID, 316 332 startedAt: Date.now(), ··· 347 363 test('drops reposts of other users; fetched_posts counts only author-owned snapshots', async ({ 348 364 assert, 349 365 }) => { 350 - await TrackedProfile.create({ did: TEST_DID, handle: 'test.bsky.social', firstSeenAt: Date.now() }) 366 + await TrackedProfile.create({ 367 + did: TEST_DID, 368 + handle: 'test.bsky.social', 369 + firstSeenAt: Date.now(), 370 + }) 351 371 await BackfillJobRow.create({ 352 372 did: TEST_DID, 353 373 startedAt: Date.now(), ··· 390 410 group.each.setup(() => testUtils.db().withGlobalTransaction()) 391 411 392 412 test('failed() sets state=failed and saves error message', async ({ assert }) => { 393 - await TrackedProfile.create({ did: TEST_DID, handle: 'test.bsky.social', firstSeenAt: Date.now() }) 413 + await TrackedProfile.create({ 414 + did: TEST_DID, 415 + handle: 'test.bsky.social', 416 + firstSeenAt: Date.now(), 417 + }) 394 418 await BackfillJobRow.create({ 395 419 did: TEST_DID, 396 420 startedAt: Date.now(), ··· 416 440 group.each.setup(() => testUtils.db().withGlobalTransaction()) 417 441 418 442 test('second execution bails out when lock is already held', async ({ assert }) => { 419 - await TrackedProfile.create({ did: TEST_DID, handle: 'test.bsky.social', firstSeenAt: Date.now() }) 443 + await TrackedProfile.create({ 444 + did: TEST_DID, 445 + handle: 'test.bsky.social', 446 + firstSeenAt: Date.now(), 447 + }) 420 448 await BackfillJobRow.create({ 421 449 did: TEST_DID, 422 450 startedAt: Date.now(), ··· 506 534 507 535 test('throws if BackfillJob row is missing', async ({ assert }) => { 508 536 // No BackfillJobRow.create — just the user 509 - await TrackedProfile.create({ did: TEST_DID, handle: 'test.bsky.social', firstSeenAt: Date.now() }) 537 + await TrackedProfile.create({ 538 + did: TEST_DID, 539 + handle: 'test.bsky.social', 540 + firstSeenAt: Date.now(), 541 + }) 510 542 511 543 const atproto = makeMockAtprotoClient({ pages: [] }) 512 544 const clickhouse = makeMockClickHouseStore()
+4 -1
tests/unit/seed_top_accounts.spec.ts
··· 47 47 assert.equal(job!.state, 'running') 48 48 } 49 49 50 - assert.deepEqual(dispatched, accounts.map((a) => a.did)) 50 + assert.deepEqual( 51 + dispatched, 52 + accounts.map((a) => a.did) 53 + ) 51 54 }) 52 55 53 56 test('skips accounts that already have a TrackedProfile row', async ({ assert }) => {