Repository navigation
Remove: Remove stack trace and error code from error screen - #21450
TiagoJacobs merged 4 commits into
Conversation
WalkthroughThe changes in the pull request involve modifications primarily to the Additionally, the Sequence Diagram(s)sequenceDiagram
participant User
participant CustomUsersSettings
participant SettingsLoader
participant ErrorScreen
User->>CustomUsersSettings: Trigger error
CustomUsersSettings->>ErrorScreen: Render without code
User->>SettingsLoader: Trigger error
SettingsLoader->>ErrorScreen: Render without code
ErrorScreen->>User: Show error message
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
bigbluebutton-html5/imports/ui/components/common/error-boundary/component.jsx (1)
Line range hint
39-86: Consider refactoring error handling for consistencyWhile the
errorInfohas been removed from theFallbackcomponent, it's still being captured incomponentDidCatchand logged incomponentDidUpdate. This approach maintains error tracking capabilities for developers while simplifying the user-facing error display, which aligns with the PR objectives.However, for consistency and to potentially simplify the component further, consider the following suggestions:
- If
errorInfois no longer needed for display purposes, you might want to remove it from the component's state.- Update the
componentDidCatchandcomponentDidUpdatemethods to only work with theerrorobject, unlesserrorInfois still necessary for logging purposes.Here's a potential refactor to consider:
constructor(props) { super(props); - this.state = { error: '', errorInfo: null }; + this.state = { error: null }; } componentDidUpdate() { - const { error, errorInfo } = this.state; + const { error } = this.state; const { logMetadata: { logCode, logMessage } } = this.props; - if (error || errorInfo) { + if (error) { logger.error({ logCode, extraInfo: { errorMessage: error?.message, errorStack: error?.stack, - errorInfo, }, }, logMessage); } } -componentDidCatch(error, errorInfo) { +componentDidCatch(error) { // ... (existing code) this.setState({ error, - errorInfo, }); }This refactor would streamline the error handling process and make it consistent with the removal of
errorInfofrom the user-facing components. However, please ensure that removingerrorInfofrom logging doesn't impact your ability to debug issues effectively.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- bigbluebutton-html5/imports/ui/components/common/error-boundary/component.jsx (1 hunks)
- bigbluebutton-html5/imports/ui/components/error-screen/component.jsx (0 hunks)
💤 Files with no reviewable changes (1)
- bigbluebutton-html5/imports/ui/components/error-screen/component.jsx
🧰 Additional context used
🔇 Additional comments (3)
bigbluebutton-html5/imports/ui/components/common/error-boundary/component.jsx (3)
Line range hint
118-123: HOC withErrorBoundary remains compatibleThe higher-order component
withErrorBoundaryremains unchanged and compatible with the updatedErrorBoundarycomponent. It continues to wrap components withErrorBoundary, passing theFallbackComponentas expected.This consistency ensures that existing uses of
withErrorBoundaryin the codebase will automatically benefit from the removal of the stack trace in error displays without requiring additional changes.
Line range hint
1-123: Summary: Effective removal of stack trace from error displayThe changes in this file successfully achieve the PR objective of removing the stack trace from the error screen. Key points:
- The
errorInfoprop has been removed from theFallbackcomponent in therendermethod, simplifying the error display for users.- Error logging for developers is maintained in
componentDidCatchandcomponentDidUpdate, preserving debugging capabilities.- The
withErrorBoundaryHOC remains compatible with these changes, ensuring consistent behavior across the application.These modifications improve the user experience by reducing potentially confusing technical information in error messages while maintaining necessary error tracking for developers.
The implementation effectively balances user experience improvements with developer needs. Consider the earlier suggestions for potential further refinements to error handling consistency.
105-105: Removal of errorInfo prop aligns with PR objectivesThe change on this line removes the
errorInfoprop from theFallbackcomponent, which aligns with the PR objective of removing the stack trace from the error screen. This modification simplifies the error display and prevents potential confusion for users who might misinterpret the stack trace information.To ensure that this change is consistent throughout the codebase, let's verify that the
Fallbackcomponent (likely theErrorScreen) no longer uses theerrorInfoprop:If these searches return no results, it confirms that the
errorInfoprop has been consistently removed from theErrorScreencomponent.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
bigbluebutton-html5/imports/ui/components/error-screen/component.jsx (2)
124-124: LGTM: Simplified error message handlingThe changes in the
rendermethod align well with the PR objective. Setting a default user-friendly error message and removing theerrorInforendering logic simplifies the component's output and reduces potential confusion for users.Consider using the
intl.formatMessagefunction for the default error message to ensure consistency with other translated messages:const formatedMessage = intl.formatMessage(intlMessages['500']);
Line range hint
1-168: LGTM: Successfully removed stack trace from error screenThe changes to the ErrorScreen component successfully achieve the PR objective of removing the stack trace from the error screen. The removal of
codeanderrorInfoprops, along with the simplification of the component's logic, reduces visual clutter and potential confusion for users.Consider updating the component's documentation or adding a comment to explain the rationale behind removing the stack trace. This will help future developers understand the design decision:
// The stack trace has been removed from the error screen to reduce visual clutter // and prevent potential confusion for users who may misinterpret the information. class ErrorScreen extends PureComponent { // ... }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
- bigbluebutton-html5/imports/ui/components/error-screen/component.jsx (1 hunks)
- bigbluebutton-html5/imports/ui/components/join-handler/custom-users-settings/component.tsx (0 hunks)
- bigbluebutton-html5/imports/ui/components/settings-loader/component.tsx (0 hunks)
💤 Files with no reviewable changes (2)
- bigbluebutton-html5/imports/ui/components/join-handler/custom-users-settings/component.tsx
- bigbluebutton-html5/imports/ui/components/settings-loader/component.tsx
🧰 Additional context used
🔇 Additional comments (1)
bigbluebutton-html5/imports/ui/components/error-screen/component.jsx (1)
112-116: LGTM: Simplified error loggingThe removal of the
codeprop from the error logging is consistent with the PR objective to remove stack traces from the error screen. This change simplifies the error logging without losing essential information and aligns with the modifications in propTypes and defaultProps.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
bigbluebutton-html5/imports/ui/components/connection-manager/component.tsx (1)
Line range hint
70-78: Improved error logging in errorLink functionThe use of
logger.errorfor logging GraphQL errors is a good improvement over console.log. It provides better error tracking and aligns with the project's logging practices.However, consider adding more context to the error log:
Consider modifying the error logging to include more context:
const errorLink = onError(({ graphQLErrors, networkError }) => { if (graphQLErrors) { - graphQLErrors.forEach(({ message }) => { - logger.error(`[GraphQL error]: Message: ${message}`); + graphQLErrors.forEach(({ message, locations, path }) => { + logger.error(`[GraphQL error]: Message: ${message}, Location: ${JSON.stringify(locations)}, Path: ${path}`); }); } if (networkError) { logger.error(`[Network error]: ${networkError}`); } });This change will provide more detailed information about GraphQL errors, including the location and path of the error, which can be helpful for debugging.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- bigbluebutton-html5/imports/ui/components/connection-manager/component.tsx (1 hunks)
🧰 Additional context used
🔇 Additional comments (2)
bigbluebutton-html5/imports/ui/components/connection-manager/component.tsx (2)
Line range hint
1-385: Overall impact of changes and alignment with PR objectiveThe changes in this file focus on improving error handling and logging, which is beneficial for debugging and maintenance. However, these modifications don't directly address the main PR objective of removing stack traces and error codes from the error screen.
To ensure the PR's main objective is met:
- Verify that the stack traces and error codes are indeed removed from the error screen:
#!/bin/bash # Search for any remaining references to stack traces or error codes in the error screen component rg --type typescript "stack|trace|error.*code" bigbluebutton-html5/imports/ui/components/error-screen/
- Check if there are any other files modified in this PR that directly handle the error screen display:
#!/bin/bash # List all modified files in the PR gh pr view 21450 --json files --jq '.files[].path'If there are other relevant files, they should be reviewed to ensure the PR's main objective is achieved.
4-4: LGTM: New import for GraphQLErrorThe addition of
GraphQLErrorimport from the 'graphql' package is a good practice for more precise error typing. This aligns with improving error handling, which is indirectly related to the PR's objective.To ensure this import is being utilized effectively:
|
Hello @Tainan404 |
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
bigbluebutton-html5/imports/ui/components/error-screen/component.jsx (2)
112-116: Approve changes with a minor suggestion for error logging.The removal of the
codeprop from the console error message is consistent with the PR objectives. This change simplifies the error logging without losing essential information.Consider adding more context to the error message to compensate for the removed code. For example:
console.error( { logCode: 'startup_client_usercouldnotlogin_error' }, 'User could not log in to HTML5 client', error );This way, you're logging the actual error object, which might provide more useful debugging information.
124-124: Approve changes with suggestions for improvement.The removal of the
code-based message is in line with the PR objectives. However, consider the following improvements:
- Instead of hardcoding the message, consider using the
intl.formatMessage()function for internationalization:const formattedMessage = intl.formatMessage(intlMessages['500']);
Fix the typo in the variable name from 'formatedMessage' to 'formattedMessage'.
Consider implementing a more flexible error message system that doesn't rely on error codes but still provides meaningful information to users.
Would you like assistance in implementing these suggestions?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- bigbluebutton-html5/imports/ui/components/error-screen/component.jsx (1 hunks)
🧰 Additional context used
🔇 Additional comments (1)
bigbluebutton-html5/imports/ui/components/error-screen/component.jsx (1)
Line range hint
1-1: Approve prop changes with a verification suggestion.The removal of
codeanderrorInfoprops from bothpropTypesanddefaultPropsis consistent with the PR objectives and simplifies the component's interface.To ensure that these changes don't cause issues elsewhere in the application, please run the following script to check for any remaining usage of these props:
If this script returns any results, those locations may need to be updated to remove the unused prop passing.
Automated tests Summary✅ All the CI tests have passed! |





What does this PR do?
This PR removes the stack trace from error screen to reduce the polution and not mislead the user, also removes the error code, because no pattern is followed and could cause misunderstanding of whats happening.
OBS: Future Refactor needed, relating errors and the codes so this item can be restored. #21455
How to test
Run the command
sudo bbb-conf --restartin the server.More.
New:

Old:
