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

Large amount of CustomEvent: {"isTrusted": false} #219

Open
emileturcotte opened this issue Sep 21, 2023 · 2 comments
Open

Large amount of CustomEvent: {"isTrusted": false} #219

emileturcotte opened this issue Sep 21, 2023 · 2 comments

Comments

@emileturcotte
Copy link

emileturcotte commented Sep 21, 2023

Is this a support request?
Yes

Describe the bug
I am working on a React WebApp which uses both LaunchDarkly and AppInsights. Both seem to have a concept of Custom Events.

We started having large amounts of exceptions logged in our AppInsights regarding "untrusted Custom Events", and it always seems to happen next to LaunchDarkly analytic events calls. I have yet to find anything regarding untrusted custom events in both LaunchDarkly and AppInsights documentation. I have already opened the following issue with AppInsights.

screenshot

The errorSrc being window.onerror hints at the error coming from an external script, but I cannot know for sure whether it comes from LaunchDarkly or ApplicationInsights.

To reproduce
Combine the use of launchdarkly-react-client-sdk: 2.29.4 and microsoft/applicationinsights-web: 3.0.2. When LaunchDarkly sends Analytic Events, notice if errors are logged in the browser or in AppInsights.

Expected behavior
Exceptions should not happen.

Logs
n/a

SDK version
Using launchdarkly-react-client-sdk: 2.29.4.
Using microsoft/applicationinsights-web: 3.0.2

Language version, developer tools
Using react: 18.2.0

OS/platform
OS: Windows, Linux, MacOS
Browsers: Chrome 116.0+, Edge 116.0+, Firefox 116.0+

Additional context
Add any other context about the problem here.

@louis-launchdarkly
Copy link
Contributor

Hello @emileturcotte, Thank you for reporting. I have both searched isTrusted and the LaunchDarkly track event, but nothing matches that shape (don't see isTrusted in code search, LaunchDarkly custom event has "kind": "custom" inside JSON body instead of a top-level key).

https://github.com/search?q=repo%3Alaunchdarkly%2Fjs-sdk-common+isTrusted&type=code
https://github.com/search?q=repo%3Alaunchdarkly%2Freact-client-sdk+isTrusted&type=code

We will follow the AppInsights issue.

If you don't mind digging deeper, can you search your code for any call to the LaunchDarkly client's track method and report back?
https://github.com/launchdarkly/js-sdk-common/blob/5.0.3/src/index.js#L363

@emileturcotte
Copy link
Author

Hi @louis-launchdarkly, thank you for the quick reply.

As was suggested in the other issue, this CustomEvent exception seems to refer to native browser Custom Events. However the fact that it is obfuscated by the browser seems to indicate that it comes from an external script. Does LaunchDarkly use native browser events when it comes to analytics?

As for your request, I have scouted the code and did not find any instance of us using LaunchDarkly's track method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants