From 82dec462aefe5f166862ee7642c028ce0e58e3e9 Mon Sep 17 00:00:00 2001 From: Guilhem Lemouel Date: Wed, 6 May 2026 12:34:47 +0200 Subject: [PATCH] fix: swallow 404 in checkFlowOnBehalfOf so renaming a flow doesn't toast --- frontend/src/lib/components/moveRenameManager.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/moveRenameManager.ts b/frontend/src/lib/components/moveRenameManager.ts index 61a40f5b25..18030eb405 100644 --- a/frontend/src/lib/components/moveRenameManager.ts +++ b/frontend/src/lib/components/moveRenameManager.ts @@ -5,13 +5,22 @@ type ItemKind = 'flow' | 'script' | 'app' /** * Check whether a flow uses on_behalf_of_email. * Callers use this to show a warning before saving. + * + * Returns `undefined` if the flow doesn't exist at that path (e.g. a draft, or + * a path the user is mid-edit). Missing-flow is a valid "no on-behalf" answer, + * not an error — and surfacing it via the global rejection handler would toast + * "Flow not found" while the user just opens the rename popover. */ export async function checkFlowOnBehalfOf( workspace: string, path: string ): Promise { - const flow = await FlowService.getFlowByPath({ workspace, path }) - return flow.on_behalf_of_email + try { + const flow = await FlowService.getFlowByPath({ workspace, path }) + return flow.on_behalf_of_email + } catch { + return undefined + } } /**