Skip to content

test(ShareSheet-error-resilience): ShareSheet hydration stability, exception safety and error fallbacks#3566

Merged
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
Subhooo5:test/sharesheet-error-resilience
Jun 4, 2026
Merged

test(ShareSheet-error-resilience): ShareSheet hydration stability, exception safety and error fallbacks#3566
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
Subhooo5:test/sharesheet-error-resilience

Conversation

@Subhooo5
Copy link
Copy Markdown
Contributor

@Subhooo5 Subhooo5 commented Jun 3, 2026

Description

Fixes #2618

  • Created components/dashboard/ShareSheet.error-resilience.test.tsx with a local ErrorBoundary class component that acts as the "localized boundary element" — catches render-phase exceptions, logs to console.error (dev telemetry), and renders a named recovery UI with a reset button
  • mockUseShareActions is exposed at module scope so individual tests can override it to throw
  • Test 1: isOpen=false produces zero DOM nodes — validates the null-render hydration path with no client/server mismatch risk
  • Test 2: isOpen=true mounts cleanly with all key structural elements present — confirms stable baseline hydration
  • Test 3: useShareActions throwing during render is caught by ErrorBoundary; fallback UI renders, console.error is called with the exception (telemetry assertion), and a Try again reset button is present on the recovery panel
  • Test 4: window.open stubbed to throw simulates a browser policy block; component tree remains mounted and interactive after the event-handler error (React 18 does not unmount on event errors)
  • Test 5: exportData with all-zero/empty values renders without throwing and shows no error fallback — confirms defensive prop handling

Pillar

  • 🛠️ Other (Bug fix, refactoring, docs)

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/api/streak?user=YOUR_USERNAME).
  • I have run npm run format and npm run lint locally and resolved all errors.
  • My commits follow the Conventional Commits format.
  • I have starred the repo.
  • I have made sure that i have only one commit to merge in this PR.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Jun 3, 2026

@Subhooo5 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Subhooo5 Subhooo5 changed the title test: ShareSheet hydration stability, exception safety and error fallbacks test(ShareSheet-error-resilience): ShareSheet hydration stability, exception safety and error fallbacks Jun 3, 2026
@Subhooo5
Copy link
Copy Markdown
Contributor Author

Subhooo5 commented Jun 3, 2026

Hey @JhaSourav07 Test added successfully. All existing tests pass locally. Feel free to review, add necessary labels and merge it. 🫂🚀

@JhaSourav07 JhaSourav07 added GSSoC 2026 level:intermediate Moderate complexity tasks quality:exceptional Outstanding contribution with exceptional implementation quality, testing. gssoc:approved PR has been reviewed and accepted for valid contribution points labels Jun 4, 2026
@JhaSourav07 JhaSourav07 merged commit bfcea5a into JhaSourav07:main Jun 4, 2026
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved PR has been reviewed and accepted for valid contribution points GSSoC 2026 level:intermediate Moderate complexity tasks quality:exceptional Outstanding contribution with exceptional implementation quality, testing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(ShareSheet-error-resilience): verify Hydration Stability, Exception Safety & Error Fallbacks (Variation 6)

2 participants