Skip to content

Fix stats page crashing#1081

Merged
elie222 merged 1 commit intomainfrom
fix/stats-crash
Dec 9, 2025
Merged

Fix stats page crashing#1081
elie222 merged 1 commit intomainfrom
fix/stats-crash

Conversation

@elie222
Copy link
Owner

@elie222 elie222 commented Dec 9, 2025

Prevent Stats page crashes by guarding ResponseTimeAnalytics on data.summary and isolating each Stats section with ErrorBoundary fallbacks

Adds local ErrorBoundary wrappers around Stats sections with a shared SectionError fallback and updates ResponseTimeAnalytics to render only when data.summary exists. Also bumps version to v2.21.57. Key files: ResponseTimeAnalytics.tsx, Stats.tsx.

📍Where to Start

Start with the Stats composition and error handling in Stats.tsx, then review the render guard in ResponseTimeAnalytics.tsx.


Macroscope summarized 18dd534.

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced error handling for stats sections with standardized error messages when data fails to load, improving overall reliability.
  • Chores

    • Version bumped to v2.21.57.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
inbox-zero Building Building Preview Dec 9, 2025 7:44am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 9, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Three files modified: ResponseTimeAnalytics.tsx introduces a narrower rendering guard requiring the summary field; Stats.tsx wraps major stats sections in ErrorBoundary components with SectionError fallbacks; version.txt incremented from v2.21.56 to v2.21.57.

Changes

Cohort / File(s) Summary
Error handling enhancements
apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx
Added ErrorBoundary wrappers around Summary, Email Analytics, Response Time, Rule Stats, and Email Actions sections; introduced SectionError fallback component displaying CardBasic with standardized error messages; updated conditional rendering of EmailActionsAnalytics to include ErrorBoundary.
Guard condition refinement
apps/web/app/(app)/[emailAccountId]/stats/ResponseTimeAnalytics.tsx
Narrowed rendering guard from data && (...) to data?.summary && (...), requiring the summary field to exist before rendering.
Version bump
version.txt
Updated version from v2.21.56 to v2.21.57.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–25 minutes

  • Stats.tsx error boundary implementation: Verify all major sections are correctly wrapped with ErrorBoundary and that SectionError fallbacks render consistently; check import statements for ErrorBoundary and CardBasic.
  • ResponseTimeAnalytics.tsx guard refinement: Confirm the narrower guard condition (data?.summary) doesn't cause UI regression when summary is undefined but other data properties exist.
  • EmailActionsAnalytics conditional wrapping: Ensure the isAccountOwner condition and ErrorBoundary wrapping logic interact correctly.

Possibly related PRs

Poem

🐰 Hop along with error bounds so fine,
Each section wrapped in guardian's design!
When things go wrong, we softly fall,
SectionErrors catch them all! 🛡️

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/stats-crash

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2cd8e53 and 18dd534.

📒 Files selected for processing (3)
  • apps/web/app/(app)/[emailAccountId]/stats/ResponseTimeAnalytics.tsx (1 hunks)
  • apps/web/app/(app)/[emailAccountId]/stats/Stats.tsx (2 hunks)
  • version.txt (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@elie222 elie222 merged commit 51c6d40 into main Dec 9, 2025
12 of 14 checks passed
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

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.

1 participant

Comments