Skip to content

Make notify_user step non-fatal in publish approve - #484

Merged
neuromechanist merged 2 commits into
devfrom
feature/issue-477-notify-non-fatal
May 14, 2026
Merged

neuromechanist merged 2 commits into
devfrom
feature/issue-477-notify-non-fatal

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Closes #477.

Summary

`notify_user` (step 15) now catches Resend failures instead of returning HTTP 500. Mirrors the `sync_nemar` non-fatal pattern.

Changes

  • `backend/src/routes/admin.ts`: on failure, logs to `console.error`, writes `notify_user_failed` audit entry, calls `updateProgress("notify_user", msg)` to persist the failed step, and sets `notifyUserWarning`. The final response combines `notifyUserWarning` with any `auditWarning` into a single `warning` field.
  • `src/lib/api.ts`: added `warning?: string` to `PublishApproveResponse`.
  • `src/commands/admin.ts`: prints the warning in yellow after step results.

Test

`test/publish-progress.test.ts` gets a new test that injects a Resend failure via the existing `Bun.serve` fake backend and asserts: orchestrator does not throw, status is `published`, `notify_user` step has `status: failed`, and `result.warning` contains the email failure message.

`bun test test/publish-progress.test.ts` — 10/10 pass.

Rationale

After step 7 (`publish_doi`), the dataset is irreversibly public with a minted DOI. Halting at step 15 leaves operators needing `--resume` for what amounts to a transient Resend outage. The notification is best-effort; the orchestrator should reach `status: published` even if mail fails.

@github-actions

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR484

Version: 0.8.14-PR484.68ca3b5
Commit: 68ca3b5


🤖 Updated on each push.

@neuromechanist
neuromechanist merged commit 3e00e8b into dev May 14, 2026
2 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-477-notify-non-fatal branch May 14, 2026 12:34

This branch was previously deployed

1 inactive deployment
npm — d17505c4 Deployed May 14, 2026 by neuromechanist via publish #862
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.

1 participant