Skip to content

Commit 419b1f5

Browse files
committed
fix(posthog): isolate processQueuedResumes errors, simplify settings posthog deps
1 parent 51d728f commit 419b1f5

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

apps/sim/app/workspace/[workspaceId]/settings/[section]/settings.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { useEffect, useRef } from 'react'
3+
import { useEffect } from 'react'
44
import dynamic from 'next/dynamic'
55
import { useSearchParams } from 'next/navigation'
66
import { usePostHog } from 'posthog-js/react'
@@ -163,10 +163,6 @@ export function SettingsPage({ section }: SettingsPageProps) {
163163
const mcpServerId = searchParams.get('mcpServerId')
164164
const { data: session, isPending: sessionLoading } = useSession()
165165
const posthog = usePostHog()
166-
const posthogRef = useRef(posthog)
167-
useEffect(() => {
168-
posthogRef.current = posthog
169-
}, [posthog])
170166

171167
const isAdminRole = session?.user?.role === 'admin'
172168
const effectiveSection =
@@ -183,8 +179,8 @@ export function SettingsPage({ section }: SettingsPageProps) {
183179

184180
useEffect(() => {
185181
if (sessionLoading) return
186-
posthogRef.current?.capture('settings_tab_viewed', { section: effectiveSection })
187-
}, [effectiveSection, sessionLoading])
182+
posthog?.capture('settings_tab_viewed', { section: effectiveSection })
183+
}, [effectiveSection, sessionLoading, posthog])
188184

189185
return (
190186
<div>

apps/sim/lib/workflows/executor/execute-workflow.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,14 @@ export async function executeWorkflow(
153153
}
154154
}
155155
} else {
156-
await PauseResumeManager.processQueuedResumes(executionId)
156+
try {
157+
await PauseResumeManager.processQueuedResumes(executionId)
158+
} catch (resumeError) {
159+
logger.error(`[${requestId}] Failed to process queued resumes`, {
160+
executionId,
161+
error: resumeError instanceof Error ? resumeError.message : String(resumeError),
162+
})
163+
}
157164
}
158165

159166
if (streamConfig?.skipLoggingComplete) {

0 commit comments

Comments
 (0)