diff --git a/packages/bsky/src/api/blob-resolver.ts b/packages/bsky/src/api/blob-resolver.ts index 2a58bb10769..c307152c43a 100644 --- a/packages/bsky/src/api/blob-resolver.ts +++ b/packages/bsky/src/api/blob-resolver.ts @@ -10,7 +10,6 @@ import AppContext from '../context' import { httpLogger as log } from '../logger' import { retryHttp } from '../util/retry' import { Database } from '../db' -import { sql } from 'kysely' // Resolve and verify blob from its origin host @@ -85,14 +84,8 @@ export async function resolveBlob( ) { const cidStr = cid.toString() - const [{ pds }, takedownStatus, takedown] = await Promise.all([ + const [{ pds }, takedown] = await Promise.all([ idResolver.did.resolveAtprotoData(did), // @TODO cache did info - db.db - .selectFrom('moderation_subject_status') - .select('id') - .where('blobCids', '@>', sql`CAST(${JSON.stringify([cidStr])} AS JSONB)`) - .where('takendown', 'is', true) - .executeTakeFirst(), db.db .selectFrom('blob_takedown') .select('takedownRef') @@ -100,7 +93,7 @@ export async function resolveBlob( .where('cid', '=', cid.toString()) .executeTakeFirst(), ]) - if (takedownStatus || takedown) { + if (takedown) { throw createError(404, 'Blob not found') } diff --git a/packages/dev-env/src/pds.ts b/packages/dev-env/src/pds.ts index 1864d6e2bf0..44b8a063fce 100644 --- a/packages/dev-env/src/pds.ts +++ b/packages/dev-env/src/pds.ts @@ -47,7 +47,7 @@ export class TestPds { bskyAppViewUrl: 'https://appview.invalid', bskyAppViewDid: 'did:example:invalid', bskyAppViewCdnUrlPattern: 'http://cdn.appview.com/%s/%s/%s', - modServiceUrl: 'https:/moderator.invalid', + modServiceUrl: 'https://moderator.invalid', modServiceDid: 'did:example:invalid', plcRotationKeyK256PrivateKeyHex: plcRotationPriv, inviteRequired: false, diff --git a/packages/ozone/build.js b/packages/ozone/build.js index 3822d9bc98f..45d59b50f8e 100644 --- a/packages/ozone/build.js +++ b/packages/ozone/build.js @@ -13,7 +13,6 @@ require('esbuild').build({ external: [ // Referenced in pg driver, but optional and we don't use it 'pg-native', - 'sharp', ], plugins: buildShallow ? [nodeExternalsPlugin()] : [], }) diff --git a/packages/pds/src/config/config.ts b/packages/pds/src/config/config.ts index 0d737fbd0fa..2f8f295b2b0 100644 --- a/packages/pds/src/config/config.ts +++ b/packages/pds/src/config/config.ts @@ -167,23 +167,16 @@ export const envToCfg = (env: ServerEnvironment): ServerConfig => { repoBackfillLimitMs: env.repoBackfillLimitMs ?? DAY, } - if (!env.bskyAppViewUrl) { - throw new Error('Must configure PDS_BSKY_APP_VIEW_URL') - } else if (!env.bskyAppViewDid) { - throw new Error('Must configure PDS_BSKY_APP_VIEW_DID') - } + assert(env.bskyAppViewUrl) + assert(env.bskyAppViewDid) const bskyAppViewCfg: ServerConfig['bskyAppView'] = { url: env.bskyAppViewUrl, did: env.bskyAppViewDid, cdnUrlPattern: env.bskyAppViewCdnUrlPattern, } - if (!env.modServiceUrl) { - throw new Error('Must configure PDS_MOD_SERVICE_URL') - } else if (!env.modServiceDid) { - throw new Error('Must configure PDS_MOD_SERVICE_DID') - } - + assert(env.modServiceUrl) + assert(env.modServiceDid) const modServiceCfg: ServerConfig['modService'] = { url: env.modServiceUrl, did: env.modServiceDid, diff --git a/packages/xrpc/src/client.ts b/packages/xrpc/src/client.ts index e9e41080dca..6603345608a 100644 --- a/packages/xrpc/src/client.ts +++ b/packages/xrpc/src/client.ts @@ -115,9 +115,6 @@ export class ServiceClient { this.baseClient.lex.assertValidXrpcOutput(methodNsid, res.body) } catch (e: any) { if (e instanceof ValidationError) { - console.log(methodNsid) - console.log(res.body) - console.log('E: ', e) throw new XRPCInvalidResponseError(methodNsid, e, res.body) } else { throw e