Skip to content

fix: don't report a write as failed when only the GUI update after the commit fails - #61

Merged
tabedzki merged 1 commit into
t3/load-schemas-after-loginfrom
t3/report-post-commit-failures
Dec 1, 2026
Merged

tabedzki merged 1 commit into
t3/load-schemas-after-loginfrom
t3/report-post-commit-failures

Conversation

@tabedzki

@tabedzki tabedzki commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Fixes #60

Stacked on #59 (which is on #58, which is on #57). Merge those first; GitHub retargets this one to main as each merges.

Problem

In createRecording, CreateNewJob, RerunJob and RegisterPreParamList, the work after conn.commitTransaction runs in the same try as the inserts: refreshing the tables, the success dialog and resetting the form. If any of it threw, the catch treated the write as failed. It reported a failure to Slack, said "Recording was not created" (or the job/steps equivalent) and re-enabled the button, though the rows were committed. For createRecording the files were already moved to cup, so a retry would register the recording a second time.

Found in the code review of #57–#59; it predates them.

Fix

  • Each of the four callbacks sets committed = true right after the commit.
  • If something fails after that, the catch shows a warning that the write succeeded and only updating the GUI failed, resets the busy label, and returns. Nothing goes to Slack, and the button stays as it is after a success, so the same write can't be repeated by accident.
  • Failures before the commit are handled exactly as before (rollback through cancelOpenTransaction, Slack, error dialog, button back on).
  • registerSurgery already got the equivalent change in fix: ask before registering a recording whose surgery was not registered #58 (the figure is closed after the try).

Screenshots

What createRecording now shows when the recording was committed but refreshing the tables failed (before: "Recording was not created" and a failure on Slack):

Recording was registered, but updating the GUI failed

Rendered in MATLAB R2023b by calling the PR's code with a stand-in figure, not on a rig. The dialog is the same uiconfirm call as in the PR, with an example id and error.

Tests

  • No new automated test: the change is inside the App Designer callbacks, and the only way to test it without a GUI and a DB would be checking the source text, which we don't do.
  • All MATLAB suites pass (85 tests). checkcode shows only the existing datestr/now warnings, and the RecordingProcessJobGUI class still loads. uvx prek run --all-files passes.

Not tested: a real post-commit failure through the GUI on a rig.

Assisted-by: ClaudeCode:claude-opus-5-5

…e commit fails

createRecording, CreateNewJob, RerunJob and RegisterPreParamList refresh
their tables and show the success dialog inside the try that holds the
inserts. If any of that threw after the commit, the catch reported a failed
write to Slack, told the user nothing was created and re-enabled the button,
though the rows were committed. For createRecording the files were already
on cup, so a retry would register the recording twice.

Each callback now notes the commit. A failure after it shows a warning that
the write succeeded and only updating the GUI failed, sends nothing to
Slack, and leaves the button as success does.

Fixes #60

Assisted-by: ClaudeCode:claude-opus-5-5
@vrrigs
vrrigs force-pushed the t3/report-post-commit-failures branch from 536a96b to 869c695 Compare December 1, 2026 21:16
@tabedzki
tabedzki marked this pull request as ready for review December 1, 2026 21:58
@tabedzki
tabedzki added this pull request to stack #62 December 1, 2026 22:19
@tabedzki
tabedzki merged commit 9cf9100 into main Dec 1, 2026
7 checks passed
@tabedzki
tabedzki deleted the t3/report-post-commit-failures branch December 1, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A failure after the commit is reported as a failed write

1 participant