Skip to content

Replay: Error when capturing keyboard event without key #8237

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

Closed
3 tasks done
bjornharvold opened this issue May 29, 2023 · 1 comment · Fixed by #8246
Closed
3 tasks done

Replay: Error when capturing keyboard event without key #8237

bjornharvold opened this issue May 29, 2023 · 1 comment · Fixed by #8246
Assignees
Labels
Package: replay Issues related to the Sentry Replay SDK

Comments

@bjornharvold
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/angular

SDK Version

7.52.1

Framework Version

7.52.1

Link to Sentry event

https://wink-travel.sentry.io/issues/4212802473/?alert_rule_id=652630&alert_timestamp=1685286765620&alert_type=email&environment=prod&project=1406670&referrer=alert_email

SDK Setup

Sentry.init({
  release: `${VERSION.version}`,
  environment: environment.environment,
  ignoreErrors: ['ResizeObserver loop limit exceeded'],
  dsn: 'https://[email protected]/1406670',
  // beforeSend(event, hint) {
  //   const eventConditional = event?.exception?.values != null && event?.exception?.values[0]?.value?.startsWith('Non-Error exception captured');
  //   let messageConditional = false;

  //   if (hint?.originalException != null && hint?.originalException instanceof Error) {
  //     const originalExceptionError: Error = hint.originalException;
  //     messageConditional = originalExceptionError.message.startsWith('Non-Error exception captured');
  //   }
  //   /* eslint-disable */
  //   const isNonErrorException = eventConditional || messageConditional;
  //   /* eslint-enable */

  //   if (isNonErrorException) {
  //     // We want to ignore those kind of errors
  //     console.warn('Received a non-standard error', event);
  //     return null;
  //   }
  //   return event;
  // },
// This sets the sample rate to be 10%. You may want this to be 100% while
  // in development and sample at a lower rate in production
  replaysSessionSampleRate: 0.1,
  // If the entire session is not sampled, use the below sample rate to sample
  // sessions when an error occurs.
  replaysOnErrorSampleRate: 1.0,
  integrations: [
    new Sentry.Replay({
      networkDetailAllowUrls: environment.sentry.networkDetailAllowUrls,
      networkRequestHeaders: environment.sentry.networkRequestHeaders,
      networkResponseHeaders: environment.sentry.networkResponseHeaders,
    }),
    new BrowserTracing({
      tracingOrigins: environment.sentry.tracingOrigins,
      routingInstrumentation: Sentry.routingInstrumentation,
    }),
  ],
 tracesSampleRate: 0.2,
});

Steps to Reproduce

This error was created by a customer. There should be enough information in the Sentry event URL

Expected Result

Should not see any errors

Actual Result

Sentry error occurring

@lforst
Copy link
Contributor

lforst commented May 30, 2023

Thanks for reporting this!

@lforst lforst added the Package: replay Issues related to the Sentry Replay SDK label May 30, 2023
@lforst lforst changed the title 🐛 Picked up Sentry error in Replay code Replay: undefined is not an object (evaluating 'h.length') May 30, 2023
@mydea mydea changed the title Replay: undefined is not an object (evaluating 'h.length') Replay: Error when capturing keyboard event without key May 30, 2023
@mydea mydea self-assigned this May 30, 2023
mydea added a commit that referenced this issue May 30, 2023
`key` _should_ always be there, but let's guard against this as it seems
it may be undefined.

Fixes #8237
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: replay Issues related to the Sentry Replay SDK
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants