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

fix: Page titles in breadcrumbs should not change #551

Merged
merged 1 commit into from
Sep 12, 2022
Merged
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
10 changes: 3 additions & 7 deletions src/main/integrations/electron-breadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,10 @@ export class ElectronBreadcrumbs implements Integration {
};

if (id) {
const state = getRendererProperties(id);
breadcrumb.data = { ...getRendererProperties(id) };
Copy link
Contributor

Choose a reason for hiding this comment

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

getRendererProperties could return null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unless I'm mistaken, getRendererProperties should only ever return some object or undefined, which this change should handle. Am I overlooking something?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh interesting, I didn't think ...null was valid JS 🤔 Apparently it is?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah this should be fine to cover the case here.


if (!this._options.captureWindowTitles && state?.title) {
delete state.title;
}

if (state) {
breadcrumb.data = state;
if (!this._options.captureWindowTitles && breadcrumb.data?.title) {
delete breadcrumb.data?.title;
}
}

Expand Down