Skip to content

ref(app-platform): Add ErrorBoundary for Sentry App Components #13511

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

Merged
merged 2 commits into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Truncate from 'app/components/truncate';
import OpenInContextLine from 'app/components/events/interfaces/openInContextLine';
import SentryAppComponentsStore from 'app/stores/sentryAppComponentsStore';
import space from 'app/styles/space';
import ErrorBoundary from 'app/components/errorBoundary';

export function trimPackage(pkg) {
const pieces = pkg.split(/^([a-z]:\\|\\\\)/i.test(pkg) ? '\\' : '/');
Expand Down Expand Up @@ -312,12 +313,14 @@ const Frame = createReactClass({
className={className}
>
{hasComponents && (
<OpenInContextLine
key={index}
lineNo={line[0]}
filename={data.filename}
components={components}
/>
<ErrorBoundary mini>
<OpenInContextLine
key={index}
lineNo={line[0]}
filename={data.filename}
components={components}
/>
</ErrorBoundary>
)}
</ContextLine>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {t} from 'app/locale';
import SentryAppInstallationStore from 'app/stores/sentryAppInstallationsStore';
import SentryAppComponentsStore from 'app/stores/sentryAppComponentsStore';
import ExternalIssueStore from 'app/stores/externalIssueStore';
import ErrorBoundary from 'app/components/errorBoundary';

class ExternalIssueList extends AsyncComponent {
static propTypes = {
Expand Down Expand Up @@ -130,14 +131,16 @@ class ExternalIssueList extends AsyncComponent {
const issue = (externalIssues || []).find(i => i.serviceType == sentryApp.slug);

return (
<SentryAppExternalIssueActions
key={sentryApp.slug}
group={group}
event={this.props.event}
sentryAppComponent={component}
sentryAppInstallation={installation}
externalIssue={issue}
/>
<ErrorBoundary key={sentryApp.slug} mini>
<SentryAppExternalIssueActions
key={sentryApp.slug}
group={group}
event={this.props.event}
sentryAppComponent={component}
sentryAppInstallation={installation}
externalIssue={issue}
/>
</ErrorBoundary>
);
});
}
Expand Down
18 changes: 11 additions & 7 deletions src/sentry/static/sentry/app/components/group/sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react';
import {isEqual, pickBy, keyBy, isObject} from 'lodash';
import createReactClass from 'create-react-class';

import ErrorBoundary from 'app/components/errorBoundary';
import SentryTypes from 'app/sentryTypes';
import withApi from 'app/utils/withApi';
import SuggestedOwners from 'app/components/group/suggestedOwners';
Expand Down Expand Up @@ -246,13 +247,16 @@ const GroupSidebar = createReactClass({
project={project}
allEnvironments={this.state.allEnvironmentsGroupData}
/>
<ExternalIssueList
event={this.props.event}
group={this.props.group}
project={project}
orgId={organization.slug}
sentryAppInstallations={sentryAppInstallations}
/>

<ErrorBoundary mini>
<ExternalIssueList
event={this.props.event}
group={this.props.group}
project={project}
orgId={organization.slug}
sentryAppInstallations={sentryAppInstallations}
/>
</ErrorBoundary>

{this.renderPluginIssue()}

Expand Down