Skip to content

Clarify analytics dashboard 404 fallback error#21

Open
kali113 wants to merge 1 commit intomasterfrom
codex/fix-analytics-404-message
Open

Clarify analytics dashboard 404 fallback error#21
kali113 wants to merge 1 commit intomasterfrom
codex/fix-analytics-404-message

Conversation

@kali113
Copy link
Copy Markdown
Owner

@kali113 kali113 commented Feb 26, 2026

Summary

  • improve analytics dashboard fallback error message when API endpoint is missing (404)
  • keep existing behavior for all other statuses

Validation

  • cd web && npm run check
  • cd web && npm run test
  • cd web && npm run build
  • cd api && npm run test -- --run

Copilot AI review requested due to automatic review settings February 26, 2026 16:09
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
anglicus 1cb75ca Commit Preview URL

Branch Preview URL
Feb 26 2026, 04:07 PM

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves the web analytics dashboard’s client-side error handling by providing a clearer fallback message specifically for missing API endpoints (HTTP 404), while keeping the existing fallback for all other error statuses.

Changes:

  • Adds a 404-specific fallback error message in the analytics dashboard fetch error parser.
  • Preserves the existing fallback message for non-404 responses.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +64 to +70
const fallbackMessage =
response.status === 404
? "Analytics endpoint not found (404). Deploy the latest API and verify VITE_BACKEND_URL."
: "Analytics request failed";

return {
message: parsed?.error?.message || "Analytics request failed",
message: parsed?.error?.message || fallbackMessage,
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

This adds new 404-specific fallback messaging but the behavior isn’t covered by tests. Since the web repo already has Vitest unit tests for similar $lib network/client utilities, consider adding a small unit test for parseError (or fetchAnalyticsDashboard) verifying that a 404 with a non-JSON body produces the new fallback message while non-404 statuses keep the existing fallback.

Copilot uses AI. Check for mistakes.
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.

2 participants