Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ErrorBoundary): rework error page #1983

Merged
merged 2 commits into from
Feb 27, 2025

Conversation

artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented Feb 25, 2025

Closes #1583

Where I checked my QRs:

Stand: https://nda.ya.ru/t/MrUUOOfl7CHYFg

Screenshot 2025-02-25 at 16 56 58

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
262 260 0 2 0

😟 No changes in tests. 😕

Bundle Size: 🔺

Current: 80.72 MB | Main: 80.62 MB
Diff: +0.10 MB (0.12%)

⚠️ Bundle size increased. Please review.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

@artemmufazalov artemmufazalov force-pushed the 1583-improve-error-boundary branch from e69684b to 57d9b37 Compare February 25, 2025 13:49
}
}

return '';
Copy link
Member Author

Choose a reason for hiding this comment

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

Return empty string instead of some placeholder to reduce output size in case of unknown error

@artemmufazalov artemmufazalov force-pushed the 1583-improve-error-boundary branch from 57d9b37 to ea5247e Compare February 25, 2025 13:56
userAgent: navigator.userAgent,
error: {
message: prepareErrorMessage(error),
stack: prepareErrorStack(error.stack, {trim: true, maxLength: 10}),
Copy link
Member Author

Choose a reason for hiding this comment

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

Trim and limit trace to ensure it will fit in QR

@artemmufazalov artemmufazalov marked this pull request as ready for review February 25, 2025 13:58
@artemmufazalov artemmufazalov requested review from Raubzeug and astandrik and removed request for Raubzeug February 25, 2025 13:58
}
}

function prepareErrorMessage(error: unknown) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use this logic?

Copy link
Member Author

Choose a reason for hiding this comment

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

Moved this code to utils and used in ErrorBoundary

document.body.removeChild(link);
}

export const createAndDownloadJsonFile = (data: unknown, fileName: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

did you want to add downloading of error's diagnostics?

Copy link
Member Author

Choose a reason for hiding this comment

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

I added it in first version, but then removed since we decided to replace it with QR. These functions now are used only in query diagnostics, but I left them in utils since they fit there

@astandrik astandrik requested a review from Copilot February 26, 2025 12:41
Copy link

@Copilot 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.

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/components/ErrorBoundary/ErrorBoundary.tsx:57

  • The variable 'b' is used to set the className in multiple components (e.g. in ErrorBoundaryFallback and ErrorStack) but there is no definition or import for 'b'. Make sure to import or define 'b' appropriately.
<Flex direction="column" gap={4} className={b(null)}>

@artemmufazalov artemmufazalov added this pull request to the merge queue Feb 27, 2025
Merged via the queue into main with commit 4a97195 Feb 27, 2025
7 checks passed
@artemmufazalov artemmufazalov deleted the 1583-improve-error-boundary branch February 27, 2025 13:38
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.

Improve error page view
3 participants