Skip to content

Surface non-validation error feedback on dashboard endpoint and event actions - #226

Merged
morcen merged 1 commit into
mainfrom
fix/issue-84-dashboard-action-error-feedback
Sep 16, 2026
Merged

morcen merged 1 commit into
mainfrom
fix/issue-84-dashboard-action-error-feedback

Conversation

@morcen

@morcen morcen commented Sep 15, 2026

Copy link
Copy Markdown
Owner

What was broken

Several dashboard actions in the Vue/Inertia frontend only handled the Laravel 422 validation-error case and gave no feedback at all for any other kind of failure (500, network timeout, etc.):

  • resources/js/Pages/Endpoints/Index.vue, saveEndpoint() (update path via form.put): no onError handler, so a non-validation failure left the "Saving..." state resetting with nothing shown.
  • resources/js/Pages/Endpoints/Index.vue, toggleEndpoint() and testEndpoint(): fired router.patch/router.post with no onError callback at all, so a failed activate/deactivate toggle or connection test produced zero feedback.
  • resources/js/Pages/Events/Index.vue, executeEventTrigger(): onError only reset the triggerProcessing flag and discarded the returned error payload — including schema-validation errors the backend explicitly returns when a trigger payload doesn't match the event's JSON schema (see EventController::trigger(), covered by tests/Feature/EventTriggerSchemaValidationTest.php). The modal just went back to normal with no indication of why the trigger failed.

From a user's perspective, these actions looked like they silently did nothing when they failed, making the dashboard feel unreliable and hiding real failures (including schema-validation rejections that are meant to be actionable).

What changed

  • Added onError handlers to toggleEndpoint() and testEndpoint() that surface a clear alert on failure.
  • Extended saveEndpoint()'s error handling (both the axios create path and the form.put update path) to show a generic alert when the failure isn't a field-level validation error already displayed inline.
  • Added a triggerError ref to the Events page, bound to a new <InputError> under the trigger payload field, and populated it from the errors returned by a failed trigger (schema-validation errors or a generic fallback message for other failures) instead of discarding them.

Test plan

  • vendor/bin/pint --dirty — no PHP files touched by this change, nothing to format.
  • composer test — full suite passes (256 passed, 1 pre-existing skip).
  • npm run build — confirms the Vue changes compile cleanly.
  • This fix is frontend-only; the backend contract it depends on (schema-validation errors returned from events.trigger) is already covered by tests/Feature/EventTriggerSchemaValidationTest.php, which continues to pass unmodified. There is no JS unit-test runner configured in this repo (only an orphaned Playwright e2e suite per Playwright e2e suite is orphaned: CI job was removed but specs, npm scripts, and docs remain, silently regressing UI coverage #95), so there isn't a PHPUnit-equivalent way to assert on the Vue error-handling behavior itself.

Fixes #84

🤖 Generated with Claude Code

https://claude.ai/code/session_01JTfRpkEmUvcv8AG5N26Hwh


Generated by Claude Code

…event actions

Endpoint save (update path), toggle-active, and test-connection requests on
the Endpoints page had no onError handling, so a 500 or network failure left
the button/UI looking like nothing happened. The event trigger action on the
Events page discarded its error payload entirely, including schema-validation
errors returned for a mismatched payload.

Add onError handlers that surface a clear message for non-validation
failures, and bind the trigger endpoint's validation errors to the trigger
modal via InputError instead of dropping them.

Fixes #84

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JTfRpkEmUvcv8AG5N26Hwh
@morcen
morcen merged commit ab19c1b into main Sep 16, 2026
2 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.

Multiple dashboard actions (save/toggle/test endpoint, trigger event) give no feedback on non-validation errors

1 participant