Skip to content

feat: add toast notifications for analytics data fetching errors#1356

Open
shankumar7 wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
shankumar7:fix-unhandled-promises-1350
Open

feat: add toast notifications for analytics data fetching errors#1356
shankumar7 wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
shankumar7:fix-unhandled-promises-1350

Conversation

@shankumar7
Copy link
Copy Markdown

Summary

This PR addresses unhandled promise rejections and silent failures across several components by ensuring all .catch() blocks properly log errors to the console and surface user-facing toast notifications.

Closes #1350

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / code cleanup

Changes Made

  • CommitTimeChart.tsx: Added toast.error and console.error to fetchContributions.
  • RepoAnalyticsExplorer.tsx: Added toast.error and console.error to fetchRepos.
  • StreakTracker.tsx: Added console.error to fetchStreak, fetchFreeze, handleApplyFreeze, handleCancelFreeze, and handleCopy.
  • CommunityMetrics.tsx: Added toast.error and console.error to fetchMetrics.
  • settings/page.tsx: Added toast.error to handleTogglePublic, handleToggleLeaderboard, handleRemoveAccount, and console.error to copyShareLink.

How to Test

Steps for the reviewer to verify this works:

  1. Log into the Dashboard.
  2. Open your browser's Developer Tools and go to the Network tab.
  3. Block the request URL for any of the affected APIs (e.g., contributions, streak, discussions, repo-explorer).
  4. Refresh the page and verify that a red toast notification appears and the error is logged in the Console.

Screenshots (if UI change)

N/A - Only adds toast notifications on error.

Checklist

  • Linked issue in summary
  • npm run lint passes locally
  • No TypeScript errors (npm run type-check)
  • Self-reviewed the diff
  • Added/updated tests if applicable

@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

@shankumar7 is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:feature GSSoC type bonus: new feature labels May 28, 2026
@github-actions
Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@shankumar7
Copy link
Copy Markdown
Author

@Priyanshu-byte-coder please add gssoc:approved label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc26 GSSoC 2026 contribution type:feature GSSoC type bonus: new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Unhandled Promise Rejections across multiple files

1 participant