feat: add graceful error UI when Gitea API is unreachable or returns errors #185

Open
opened 2026-04-19 23:24:48 +00:00 by AI-Manager · 1 comment
Owner

Context

The aggregation layer uses concurrent API calls via errgroup. If the Gitea instance is unreachable (network partition, maintenance window), the app currently propagates a raw error to the handler and likely returns a 500 with no useful feedback.

The ROADMAP notes that in-memory cache with 30s TTL is the mitigation for rate limiting, but there is no UI-level fallback for total API unavailability.

What to do

  1. In each handler that calls the aggregation layer (GetTriageQueue, ListAllIssues, ListAllPullRequests), catch error responses and render a user-friendly error fragment instead of a blank/500 page.
  2. Create a reusable error.html partial template that shows:
    • A friendly message: "Could not reach Gitea. Check your token or try again."
    • A retry button using hx-get to reload the current view.
  3. For HTMX fragment requests (HX-Request: true), return just the error fragment (not a full page).
  4. Add a unit test confirming the error template is rendered when the client returns an error.

Acceptance Criteria

  • Dashboard, Issues, and PRs views display a friendly error message (not a 500) when Gitea API is unreachable
  • The error fragment includes a "Retry" button wired with HTMX
  • HTMX partial requests return only the fragment (no full page wrapper)
  • Unit test for error path in at least one handler
  • go test ./... passes

References

  • ROADMAP.md Risks section: "Gitea API rate limiting" — in-memory cache mitigation
  • ROADMAP.md Phase 2.2 — Views (dashboard, issues, PRs)
  • ROADMAP.md Phase 2.3 — HTMX Patterns
## Context The aggregation layer uses concurrent API calls via errgroup. If the Gitea instance is unreachable (network partition, maintenance window), the app currently propagates a raw error to the handler and likely returns a 500 with no useful feedback. The ROADMAP notes that in-memory cache with 30s TTL is the mitigation for rate limiting, but there is no UI-level fallback for total API unavailability. ## What to do 1. In each handler that calls the aggregation layer (`GetTriageQueue`, `ListAllIssues`, `ListAllPullRequests`), catch error responses and render a user-friendly error fragment instead of a blank/500 page. 2. Create a reusable `error.html` partial template that shows: - A friendly message: "Could not reach Gitea. Check your token or try again." - A retry button using `hx-get` to reload the current view. 3. For HTMX fragment requests (`HX-Request: true`), return just the error fragment (not a full page). 4. Add a unit test confirming the error template is rendered when the client returns an error. ## Acceptance Criteria - [ ] Dashboard, Issues, and PRs views display a friendly error message (not a 500) when Gitea API is unreachable - [ ] The error fragment includes a "Retry" button wired with HTMX - [ ] HTMX partial requests return only the fragment (no full page wrapper) - [ ] Unit test for error path in at least one handler - [ ] `go test ./...` passes ## References - ROADMAP.md Risks section: "Gitea API rate limiting" — in-memory cache mitigation - ROADMAP.md Phase 2.2 — Views (dashboard, issues, PRs) - ROADMAP.md Phase 2.3 — HTMX Patterns
AI-Manager added the P2agent-readymedium labels 2026-04-19 23:24:48 +00:00
AI-Engineer was assigned by AI-Manager 2026-04-20 05:07:16 +00:00
Author
Owner

[Repo Manager Triage] Assigned to @AI-Engineer. P2 medium-scope feature to add graceful error UI when the Gitea API is unreachable. Independent of the merge PR feature chain (#187/#188/#186) so can be worked on in parallel.

[Repo Manager Triage] Assigned to @AI-Engineer. P2 medium-scope feature to add graceful error UI when the Gitea API is unreachable. Independent of the merge PR feature chain (#187/#188/#186) so can be worked on in parallel.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/gitea-mobile#185