Surface non-validation error feedback on dashboard endpoint and event actions - #226
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 viaform.put): noonErrorhandler, so a non-validation failure left the "Saving..." state resetting with nothing shown.resources/js/Pages/Endpoints/Index.vue,toggleEndpoint()andtestEndpoint(): firedrouter.patch/router.postwith noonErrorcallback at all, so a failed activate/deactivate toggle or connection test produced zero feedback.resources/js/Pages/Events/Index.vue,executeEventTrigger():onErroronly reset thetriggerProcessingflag 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 (seeEventController::trigger(), covered bytests/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
onErrorhandlers totoggleEndpoint()andtestEndpoint()that surface a clear alert on failure.saveEndpoint()'s error handling (both theaxioscreate path and theform.putupdate path) to show a generic alert when the failure isn't a field-level validation error already displayed inline.triggerErrorref 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.events.trigger) is already covered bytests/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