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

supabase / storage / 26213785588

21 May 2026 08:08AM UTC coverage: 40.286% (-34.7%) from 74.992%
26213785588

Pull #1118

github

web-flow
Merge fcbe53820 into 322ab2ebb
Pull Request #1118: fix: single callback for memory collector

2182 of 5969 branches covered (36.56%)

Branch coverage included in aggregate %.

15 of 15 new or added lines in 2 files covered. (100.0%)

3727 existing lines in 166 files now uncovered.

4335 of 10208 relevant lines covered (42.47%)

35.26 hits per line

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

50.0
/src/http/plugins/storage.ts
1
import { createStorageBackend, StorageBackendAdapter } from '@storage/backend'
2
import { CdnCacheManager } from '@storage/cdn/cdn-cache-manager'
3
import { StorageKnexDB } from '@storage/database'
4
import { PassThroughLocation, TenantLocation } from '@storage/locator'
5
import { Storage } from '@storage/storage'
6
import fastifyPlugin from 'fastify-plugin'
7
import { getConfig } from '../../config'
8

9
declare module 'fastify' {
10
  interface FastifyRequest {
11
    storage: Storage
12
    backend: StorageBackendAdapter
13
    cdnCache: CdnCacheManager
14
  }
15
}
16

17
const { storageBackendType, storageS3Bucket } = getConfig()
3✔
18

19
const storageBackend = createStorageBackend(storageBackendType)
3✔
20

21
export const storage = fastifyPlugin(
3✔
22
  async function storagePlugin(fastify) {
23
    fastify.decorateRequest('storage')
4✔
24
    fastify.addHook('preHandler', async (request) => {
4✔
UNCOV
25
      const database = new StorageKnexDB(request.db, {
×
26
        tenantId: request.tenantId,
27
        host: request.headers['x-forwarded-host'] as string,
28
        reqId: request.id,
29
        sbReqId: request.sbReqId,
30
        latestMigration: request.latestMigration,
31
      })
32

UNCOV
33
      const location = request.isIcebergBucket
×
34
        ? new PassThroughLocation(request.internalIcebergBucketName!)
35
        : new TenantLocation(storageS3Bucket)
36

UNCOV
37
      request.backend = storageBackend
×
UNCOV
38
      request.storage = new Storage(storageBackend, database, location)
×
UNCOV
39
      request.cdnCache = new CdnCacheManager(request.storage)
×
40
    })
41

42
    fastify.addHook('onClose', async () => {
4✔
43
      storageBackend.close()
4✔
44
    })
45
  },
46
  { name: 'storage-init' }
47
)
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