Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ DATABASE_CONNECTION_TIMEOUT=3000
DATABASE_SEARCH_PATH=

DATABASE_APPLICATION_NAME="Supabase Storage API"
PG_QUEUE_APPLICATION_NAME="Supabase Storage PgBoss"

## When DATABASE_POOL_URL is SET the following params are ignored
DATABASE_MAX_CONNECTIONS=20
Expand Down
5 changes: 0 additions & 5 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ type StorageConfigType = {
databaseEnableQueryCancellation: boolean
databaseStatementTimeout: number
databaseApplicationName: string
pgQueueApplicationName: string
region: string
requestTraceHeader?: string
requestEtagHeaders: string[]
Expand Down Expand Up @@ -442,10 +441,6 @@ export function getConfig(options?: { reload?: boolean }): StorageConfigType {
databaseApplicationName:
getOptionalConfigFromEnv('DATABASE_APPLICATION_NAME') ||
`Supabase Storage API ${getOptionalConfigFromEnv('VERSION') || '0.0.0'}`,
Comment on lines 441 to 443
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing PG_QUEUE_APPLICATION_NAME is a breaking configuration change for existing deployments that currently set it to tag PgBoss/queue connections. Consider supporting PG_QUEUE_APPLICATION_NAME as a deprecated fallback/alias (e.g., only if DATABASE_APPLICATION_NAME is unset) or emitting a clear startup warning so operators understand why connection tagging changed.

Suggested change
databaseApplicationName:
getOptionalConfigFromEnv('DATABASE_APPLICATION_NAME') ||
`Supabase Storage API ${getOptionalConfigFromEnv('VERSION') || '0.0.0'}`,
databaseApplicationName: (() => {
const databaseApplicationName = getOptionalConfigFromEnv('DATABASE_APPLICATION_NAME')
if (databaseApplicationName) {
return databaseApplicationName
}
const legacyQueueApplicationName = getOptionalConfigFromEnv('PG_QUEUE_APPLICATION_NAME')
if (legacyQueueApplicationName) {
console.warn(
'PG_QUEUE_APPLICATION_NAME is deprecated; please migrate to DATABASE_APPLICATION_NAME. ' +
'Support for PG_QUEUE_APPLICATION_NAME may be removed in a future release.'
)
return legacyQueueApplicationName
}
return `Supabase Storage API ${getOptionalConfigFromEnv('VERSION') || '0.0.0'}`
})(),

Copilot uses AI. Check for mistakes.
pgQueueApplicationName:
getOptionalConfigFromEnv('PG_QUEUE_APPLICATION_NAME') ||
`Supabase Storage PgBoss ${getOptionalConfigFromEnv('VERSION') || '0.0.0'}`,

// CDN
cdnPurgeEndpointURL: getOptionalConfigFromEnv('CDN_PURGE_ENDPOINT_URL'),
cdnPurgeEndpointKey: getOptionalConfigFromEnv('CDN_PURGE_ENDPOINT_KEY'),
Expand Down
4 changes: 0 additions & 4 deletions src/internal/queue/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { ERRORS } from '@internal/errors'
import { Knex } from 'knex'
import pg from 'pg'
import { Db } from 'pg-boss'
import { getConfig } from '../../config'

export class QueueDB extends EventEmitter implements Db {
opened = false
Expand All @@ -16,9 +15,6 @@ export class QueueDB extends EventEmitter implements Db {

constructor(config: pg.PoolConfig) {
super()

config.application_name = config.application_name || getConfig().pgQueueApplicationName

this.config = config
}

Expand Down
2 changes: 2 additions & 0 deletions src/internal/queue/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export abstract class Queue {
pgQueueReadWriteTimeout,
pgQueueConcurrentTasksPerQueue,
pgQueueMaxConnections,
databaseApplicationName,
} = getConfig()

let url = pgQueueConnectionURL || databaseURL
Expand All @@ -108,6 +109,7 @@ export abstract class Queue {
min: 0,
max: pgQueueMaxConnections,
connectionString: url,
application_name: databaseApplicationName,
statement_timeout: pgQueueReadWriteTimeout > 0 ? pgQueueReadWriteTimeout : undefined,
})

Expand Down
Loading