• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / storage / 25794757887

13 May 2026 10:57AM UTC coverage: 39.675% (-35.2%) from 74.849%
25794757887

Pull #1105

github

web-flow
Merge d11e8cc92 into 7e995c511
Pull Request #1105: fix: drop head after complete in multipart uploads

2119 of 5915 branches covered (35.82%)

Branch coverage included in aggregate %.

12 of 15 new or added lines in 1 file covered. (80.0%)

3731 existing lines in 165 files now uncovered.

4252 of 10143 relevant lines covered (41.92%)

35.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

10.34
/src/http/plugins/vector.ts
1
import { getTenantConfig, multitenantKnex } from '@internal/database'
2
import { ERRORS } from '@internal/errors'
3
import { KnexShardStoreFactory, ShardCatalog, SingleShard } from '@internal/sharding'
4
import {
5
  createS3VectorClient,
6
  KnexVectorMetadataDB,
7
  S3Vector,
8
  VectorStoreManager,
9
} from '@storage/protocols/vector'
10
import { FastifyInstance } from 'fastify'
11
import fastifyPlugin from 'fastify-plugin'
12
import { getConfig } from '../../config'
13

14
declare module 'fastify' {
15
  interface FastifyRequest {
16
    s3Vector: VectorStoreManager
17
  }
18
}
19

20
const s3VectorClient = createS3VectorClient()
3✔
21
const s3VectorAdapter = new S3Vector(s3VectorClient)
3✔
22

23
export const s3vector = fastifyPlugin(async function (fastify: FastifyInstance) {
3✔
UNCOV
24
  fastify.addHook('preHandler', async (req) => {
×
UNCOV
25
    const { isMultitenant, vectorS3Buckets, vectorMaxBucketsCount, vectorMaxIndexesCount } =
×
26
      getConfig()
27

UNCOV
28
    if (!vectorS3Buckets || vectorS3Buckets.length === 0) {
×
UNCOV
29
      throw ERRORS.FeatureNotEnabled('vector', 'Vector service not configured')
×
30
    }
31

UNCOV
32
    let maxBucketCount = vectorMaxBucketsCount
×
UNCOV
33
    let maxIndexCount = vectorMaxIndexesCount
×
34

UNCOV
35
    if (isMultitenant) {
×
36
      const { features } = await getTenantConfig(req.tenantId)
×
37
      maxBucketCount = features?.vectorBuckets?.maxBuckets || vectorMaxBucketsCount
×
38
      maxIndexCount = features?.vectorBuckets?.maxIndexes || vectorMaxIndexesCount
×
39
    }
40

UNCOV
41
    const db = req.db.pool.acquire()
×
UNCOV
42
    const store = new KnexVectorMetadataDB(db)
×
UNCOV
43
    const shard = isMultitenant
×
44
      ? new ShardCatalog(new KnexShardStoreFactory(multitenantKnex))
45
      : new SingleShard({
46
          shardKey: vectorS3Buckets[0],
47
          capacity: 10000,
48
        })
49

UNCOV
50
    req.s3Vector = new VectorStoreManager(s3VectorAdapter, store, shard, {
×
51
      tenantId: req.tenantId,
52
      maxBucketCount,
53
      maxIndexCount,
54
    })
55
  })
56
})
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc