Skip to content

fix: return validation errors from prompt workflow actions - #645

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
BharadwajKanneveti:fix/server-action-validation-errors
Aug 4, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
BharadwajKanneveti:fix/server-action-validation-errors

Conversation

@BharadwajKanneveti

Copy link
Copy Markdown
Contributor

Summary

Fix prompt workflow actions that were throwing user-triggerable validation errors and causing masked Server Components digest errors in production.

Changes:

  • Updated addPromptTargetUrl to return { targetUrl } | { error } instead of throwing validation errors.
  • Updated target URL handling to display validation errors inline below the input instead of showing a toast.
  • Updated addPromptNote to return { note } | { error } for validation failures.
  • Added maxLength={2000} and a character counter to the note textarea.
  • Updated acceptSuggestion to return { promptId } | { error } and handle validation failures without throwing.
  • Updated affected call sites to handle errors using the 'error' in result pattern.

Related issue

Closes #549

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean continuation of the error-as-value pattern from #547 — inline URL error with clear-on-type, and the maxLength + counter is a nice proactive touch. Thanks!

@gkhngyk
gkhngyk merged commit 6170805 into ansvisor:main Aug 4, 2026
4 checks passed
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.

Prompt workflow actions throw on validation — invalid URL, long note, and suggestion errors surface as the masked digest toast

2 participants