SIGN IN SIGN UP

fix(frontend): dedupe template flow names across projects (#14632)

* fix(frontend): dedupe template flow names across projects

Applying a starter template renamed the placeholder flow using a
folder-scoped dedupe, but the database enforces flow-name uniqueness per
user (unique_flow_name on user_id, name). A same-named flow in another
project slipped through, the PATCH came back 400 "Name must be unique"
and the template was never persisted — the canvas showed it while the
stored flow stayed empty.

Dedupe against every flow the user owns, ignoring the ownerless starter
examples that AUTO_LOGIN surfaces alongside them, and retry with the next
free version when the backend still reports a conflict. The rename is now
issued before the optimistic store swap so useSaveFlow no longer skips it
as a no-op, which also makes the existing rollback path reachable.

Fixes LE-2232

* fix(frontend): keep suppressed save errors from surfacing twice

Route every save failure through one suppression-aware reporter so a
caller that reports the rejection itself never gets a second toast from
useSaveFlow, and type the dedupe candidates as NamedFlow instead of
casting name-only entries to FlowType.

---------

Co-authored-by: Viktor Avelino <64113566+viktoravelino@users.noreply.github.com>
C
Cristhian Zanforlin Lousa committed
4a092c36369bd8be770ac750cb74fcfca52f90fb
Parent: 5616e10
Committed by GitHub <noreply@github.com> on 8/19/2026, 6:49:32 PM