Ticket-provider auth failures should surface in UI, not just logs#445
Merged
Merged
Conversation
- Add last_error, last_error_at, consecutive_failures columns to ticket_providers table so sync errors are persisted per-provider - On successful sync, clear error state; on failure, record the error message and increment consecutive failure count - Auto-disable provider after 5 consecutive failures to stop log spam - Downgrade repeated identical errors to debug level logging - Add PATCH /api/tickets/providers/:id/re-enable endpoint to clear errors and re-enable a disabled provider - Update Settings > Ticket Providers UI to show error details, disabled state, failure count, and a "Re-enable" button - Add migration and journal entry for the new columns Closes #438 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 tasks
jplorier
pushed a commit
to jplorier/optio
that referenced
this pull request
May 5, 2026
…onwiggins#445) - Add last_error, last_error_at, consecutive_failures columns to ticket_providers table so sync errors are persisted per-provider - On successful sync, clear error state; on failure, record the error message and increment consecutive failure count - Auto-disable provider after 5 consecutive failures to stop log spam - Downgrade repeated identical errors to debug level logging - Add PATCH /api/tickets/providers/:id/re-enable endpoint to clear errors and re-enable a disabled provider - Update Settings > Ticket Providers UI to show error details, disabled state, failure count, and a "Re-enable" button - Add migration and journal entry for the new columns Closes jonwiggins#438 Co-authored-by: Optio Agent <optio-agent@noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Closes #438
What changed
Ticket-provider sync errors (e.g. GitHub 401 "Bad credentials") were only visible in server logs, creating noise without any user-facing signal. This PR:
last_error,last_error_at, andconsecutive_failurescolumns to theticket_providerstable. On each sync failure the error message and failure count are recorded; on success they are cleared.debuglevel instead oferror, cutting log noise significantly.PATCH /api/tickets/providers/:id/re-enable: Clears all error state and re-enables the provider — intended for use after the user refreshes their token.How to test
Tests: 4 new test cases covering error persistence, success reset, auto-disable, and log downgrading. All 1934 tests pass. Typecheck and web build clean.