OpenFn / OpenFn/lightning

Failed auto-saves after AI apply aren't logged/reported anywhere

Open
#4,981 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

AI-First Starting UX
Dominant language
Elixir
Stars
296
Forks
86
Avg merge
1d 13h
Merged PRs (30d)
50

Description

Depends on #4848 Split out from #4876 phase 2.

The gap

When the AI assistant applies a workflow to a brand-new canvas, we
auto-save it (saveNewWorkflow in useAIWorkflowApplications.ts). If
that save fails, the only trace of it is a console.error in the
browser — nothing is reported anywhere we'd actually see it (no Sentry
event, no server-side log).

The user still gets a toast, so this isn't a silent failure from their
side. But we have no visibility into how often this happens or why —
if auto-save is flaky for some users we won't know unless they tell us.

Why it's not already covered

Most workflow-save failures that reach the server are already logged
there (and forwarded to Sentry via the existing Logger handler) — see
Session.handle_call({:save_workflow, ...}). The gap is specifically
failures that happen client-side and never reach that code path (e.g.
a channel push timeout, or the client being disconnected at the moment
the auto-save fires).

Frontend Sentry (@sentry/react, assets/js/app.js) is currently
disabled boilerplate — never wired up for real capture — so it's not a
ready-made fix here.

What to add

Some way for this client-side failure to surface as telemetry we'd
notice — either by reporting it back to the server to log (reusing the
Logger → Sentry pipeline that already works for other save failures),
or another mechanism if there's a better fit. Low complexity, no new
infra needed either way.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in useAIWorkflowApplications.ts at saveNewWorkflow, then trace Session.handle_call({:save_workflow, ...}) and the existing Logger handler. Compare the client-side failure path with the server-side logging path and choose how telemetry should be surfaced. Done means failed auto-saves produce observable telemetry without adding infrastructure.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir, javascript, react
Domain
backend, frontend, observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.