diff --git a/apps/server/src/api/v2/metric_files/download-metric-file.ts b/apps/server/src/api/v2/metric_files/download-metric-file.ts index 816ace4fd..45d7e1856 100644 --- a/apps/server/src/api/v2/metric_files/download-metric-file.ts +++ b/apps/server/src/api/v2/metric_files/download-metric-file.ts @@ -74,7 +74,7 @@ export async function downloadMetricFileHandler( // Check for timeout if (Date.now() - startTime > timeout) { throw new HTTPException(504, { - message: 'Export took too long to complete. Please try again with a smaller date range.', + message: 'Export took too long to complete. Please try again with less data.', }); } diff --git a/apps/server/src/api/v2/metric_files/index.ts b/apps/server/src/api/v2/metric_files/index.ts index 275c70bcb..ee350b8ad 100644 --- a/apps/server/src/api/v2/metric_files/index.ts +++ b/apps/server/src/api/v2/metric_files/index.ts @@ -17,11 +17,7 @@ const app = new Hono() const response = await downloadMetricFileHandler(id, user); - // Option 1: Return JSON with download URL for client to handle return c.json(response); - - // Option 2: Redirect directly to download URL (uncomment if preferred) - // return c.redirect(response.downloadUrl); }) // Error handler for metric_files routes diff --git a/packages/database/src/queries/asset-permissions/remove-asset-permission.ts b/packages/database/src/queries/asset-permissions/remove-asset-permission.ts index f29ef19c1..9a39f69bf 100644 --- a/packages/database/src/queries/asset-permissions/remove-asset-permission.ts +++ b/packages/database/src/queries/asset-permissions/remove-asset-permission.ts @@ -85,7 +85,7 @@ export async function bulkRemoveAssetPermissions( ) .returning(); - return deleted as AssetPermission[]; + return deleted; } /** diff --git a/packages/database/src/queries/metrics/get-metric-for-export.ts b/packages/database/src/queries/metrics/get-metric-for-export.ts index 36ac03874..afc1e3501 100644 --- a/packages/database/src/queries/metrics/get-metric-for-export.ts +++ b/packages/database/src/queries/metrics/get-metric-for-export.ts @@ -56,6 +56,8 @@ export async function getMetricForExport(input: GetMetricForExportInput): Promis // The content structure may vary, so we check multiple possible locations let sql: string | undefined; + //TODO: we need to use the metric type when we merge in the new ai sdk v5 branch date: 08/14/2025 + if (typeof result.content === 'object' && result.content !== null) { // Check common locations for SQL in metric content const content = result.content as Record; diff --git a/packages/database/src/queries/vault/get-data-source-credentials.ts b/packages/database/src/queries/vault/get-data-source-credentials.ts index 2adb6b7d1..f7e9862e5 100644 --- a/packages/database/src/queries/vault/get-data-source-credentials.ts +++ b/packages/database/src/queries/vault/get-data-source-credentials.ts @@ -34,8 +34,8 @@ export async function getDataSourceCredentials( // Parse and return the credentials try { return JSON.parse(secretString); - } catch (parseError) { - console.error(parseError); + } catch { + // Don't log the parse error as it may contain sensitive credential information throw new Error( `Failed to parse credentials for data source ID ${validated.dataSourceId}: Invalid JSON format` );