grafana / faro-web-sdk

The Grafana Faro Web SDK, part of the Grafana Faro project, is a highly configurable web SDK for real user monitoring (RUM) that instruments browser frontend applications to capture observability signals. Frontend telemetry can then be correlated with backend and infrastructure data for full-stack observability.
https://grafana.com/oss/faro/
Apache License 2.0
688 stars 62 forks source link

fix: crash when navigator.userAgentData is undefined #494

Closed Pajn closed 4 months ago

Pajn commented 4 months ago

Why

We have gotten several Sentry reports about a crash Cannot read properties of undefined (reading 'brands') from this file. Apparently some browsers does have the field userAgentData defined, but its value is undefined.

What

Adds an extra check that userAgentData is truthy before trying to read it.

Links

Checklist

CLAassistant commented 4 months ago

CLA assistant check
All committers have signed the CLA.

codecapitano commented 4 months ago

@Pajn would you do me a favor and add the bug fix to the changelog.

codecapitano commented 4 months ago

Hey @Pajn we released a patch version including your fix.