Problem
The dashboard renders multiple independent data widgets (streak, PR metrics, commit graph, language breakdown). If any one of them throws a JavaScript error during rendering (e.g., due to an unexpected API response shape), React unmounts the entire component tree and shows a blank page. Users lose visibility into all other dashboard sections because of a failure in just one widget.
Steps to Reproduce
- Modify the GitHub stats API to return
null for the streak field
- Load the dashboard
- Observe the entire page goes blank rather than just the streak widget showing an error state
Expected Behavior
A failed widget should show an inline error placeholder while all other widgets continue to render normally.
Proposed Fix
Wrap each independent widget in an ErrorBoundary component:
class ErrorBoundary extends React.Component {
state = { hasError: false };
static getDerivedStateFromError() { return { hasError: true }; }
render() {
if (this.state.hasError) {
return <WidgetErrorFallback message="Could not load this section." />;
}
return this.props.children;
}
}
// Usage
<ErrorBoundary><StreakWidget /></ErrorBoundary>
<ErrorBoundary><PRMetricsWidget /></ErrorBoundary>
Complexity: Level 2 | Program: GSSOC '26
Problem
The dashboard renders multiple independent data widgets (streak, PR metrics, commit graph, language breakdown). If any one of them throws a JavaScript error during rendering (e.g., due to an unexpected API response shape), React unmounts the entire component tree and shows a blank page. Users lose visibility into all other dashboard sections because of a failure in just one widget.
Steps to Reproduce
nullfor thestreakfieldExpected Behavior
A failed widget should show an inline error placeholder while all other widgets continue to render normally.
Proposed Fix
Wrap each independent widget in an
ErrorBoundarycomponent:Complexity: Level 2 | Program: GSSOC '26