Skip to content

Commit af4eb8b

Browse files
committed
fix preview + logs url for notifs
1 parent 9f14c81 commit af4eb8b

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

apps/sim/app/api/emails/preview/route.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const emailTemplates = {
100100
trigger: 'api',
101101
duration: '2.3s',
102102
cost: '$0.0042',
103-
logUrl: 'https://sim.ai/workspace/ws_123/logs?search=exec_abc123',
103+
logUrl: 'https://sim.ai/workspace/ws_123/logs?executionId=exec_abc123',
104104
}),
105105
'workflow-notification-error': () =>
106106
renderWorkflowNotificationEmail({
@@ -109,7 +109,7 @@ const emailTemplates = {
109109
trigger: 'webhook',
110110
duration: '1.1s',
111111
cost: '$0.0021',
112-
logUrl: 'https://sim.ai/workspace/ws_123/logs?search=exec_abc123',
112+
logUrl: 'https://sim.ai/workspace/ws_123/logs?executionId=exec_abc123',
113113
}),
114114
'workflow-notification-alert': () =>
115115
renderWorkflowNotificationEmail({
@@ -118,7 +118,7 @@ const emailTemplates = {
118118
trigger: 'schedule',
119119
duration: '45.2s',
120120
cost: '$0.0156',
121-
logUrl: 'https://sim.ai/workspace/ws_123/logs?search=exec_abc123',
121+
logUrl: 'https://sim.ai/workspace/ws_123/logs?executionId=exec_abc123',
122122
alertReason: '3 consecutive failures detected',
123123
}),
124124
'workflow-notification-full': () =>
@@ -128,7 +128,7 @@ const emailTemplates = {
128128
trigger: 'api',
129129
duration: '12.5s',
130130
cost: '$0.0234',
131-
logUrl: 'https://sim.ai/workspace/ws_123/logs?search=exec_abc123',
131+
logUrl: 'https://sim.ai/workspace/ws_123/logs?executionId=exec_abc123',
132132
finalOutput: { processed: 150, skipped: 3, status: 'completed' },
133133
rateLimits: {
134134
sync: { requestsPerMinute: 60, remaining: 45 },

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/file-upload/file-upload.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
import { useEffect, useMemo, useRef, useState } from 'react'
44
import { createLogger } from '@sim/logger'
5-
import { useQueryClient } from '@tanstack/react-query'
65
import { X } from 'lucide-react'
76
import { useParams } from 'next/navigation'
87
import { Button, Combobox } from '@/components/emcn/components'
98
import { Progress } from '@/components/ui/progress'
109
import { cn } from '@/lib/core/utils/cn'
1110
import { getExtensionFromMimeType } from '@/lib/uploads/utils/file-utils'
1211
import { useSubBlockValue } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-sub-block-value'
13-
import { useWorkspaceFiles, workspaceFilesKeys } from '@/hooks/queries/workspace-files'
12+
import { useWorkspaceFiles } from '@/hooks/queries/workspace-files'
1413
import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
1514
import { useWorkflowStore } from '@/stores/workflows/workflow/store'
1615

@@ -162,12 +161,11 @@ export function FileUpload({
162161
const params = useParams()
163162
const workspaceId = params?.workspaceId as string
164163

165-
const queryClient = useQueryClient()
166164
const {
167165
data: workspaceFiles = [],
168166
isLoading: loadingWorkspaceFiles,
169167
refetch: refetchWorkspaceFiles,
170-
} = useWorkspaceFiles(workspaceId)
168+
} = useWorkspaceFiles(isPreview ? '' : workspaceId)
171169

172170
const value = isPreview ? previewValue : storeValue
173171

@@ -378,7 +376,7 @@ export function FileUpload({
378376
setUploadError(null)
379377

380378
if (workspaceId) {
381-
void queryClient.invalidateQueries({ queryKey: workspaceFilesKeys.lists() })
379+
void refetchWorkspaceFiles()
382380
}
383381

384382
if (uploadedFiles.length === 1) {

apps/sim/background/workspace-notification-delivery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ function formatCost(cost?: Record<string, unknown>): string {
247247
}
248248

249249
function buildLogUrl(workspaceId: string, executionId: string): string {
250-
return `${getBaseUrl()}/workspace/${workspaceId}/logs?search=${encodeURIComponent(executionId)}`
250+
return `${getBaseUrl()}/workspace/${workspaceId}/logs?executionId=${encodeURIComponent(executionId)}`
251251
}
252252

253253
function formatAlertReason(alertConfig: AlertConfig): string {

0 commit comments

Comments
 (0)