fix(rls): add account_id to AISessionStep creations, fix boards toast
Some checks failed
CI / backend (push) Failing after 16m37s
CI / frontend (push) Failing after 45s
CI / e2e (push) Has been skipped
Mirror to GitHub / mirror (push) Successful in 3s

- flowpilot_engine: pass account_id at all 5 AISessionStep instantiation
  sites (_create_step_from_parsed x3, briefing step, status update step).
  Phase 4 RLS blocked every INSERT with NULL account_id — this broke all
  new FlowPilot sessions since the Phase 4 migration was applied.
- integrations: list_boards returns [] on PSAError instead of 502, stopping
  the spurious 'Server error' toast on dashboard load (boards are optional).
- client.ts: 5xx global toast now shows backend detail when available.
- useFlowPilotSession: startSession extracts backend detail for error state;
  suppresses duplicate toast for 5xx (global interceptor already handles it).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-15 04:41:14 +00:00
parent 567985402f
commit 0d9babb986
4 changed files with 19 additions and 6 deletions

View File

@@ -99,9 +99,14 @@ export function useFlowPilotSession(): UseFlowPilotSession {
setAllSteps([firstStep])
setCurrentStep(firstStep)
} catch (e: unknown) {
const message = e instanceof Error ? e.message : 'Failed to start session'
// Prefer the backend's detail message over the generic axios status string
const detail = (e as any)?.response?.data?.detail
const message = typeof detail === 'string' ? detail : (e instanceof Error ? e.message : 'Failed to start session')
setError(message)
toast.error(message)
// Global axios interceptor already shows a toast for 5xx — skip duplicate
if (!(e as any)?.response?.status || (e as any)?.response?.status < 500) {
toast.error(message)
}
} finally {
setIsLoading(false)
}