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

Intercom, Sentry, and Turbolinks don't play nicely together #324

Open
jhubert opened this issue Apr 3, 2020 · 5 comments
Open

Intercom, Sentry, and Turbolinks don't play nicely together #324

jhubert opened this issue Apr 3, 2020 · 5 comments

Comments

@jhubert
Copy link

jhubert commented Apr 3, 2020

Version info

  • intercom-rails version: 0.4.1
  • Rails version: 5.2.4.2

Expected behavior

A vanilla installation of Rails 5 with Turbolinks, Sentry, and Intercom should not produce errors in IE.

Actual behavior

We're seeing millions of JS errors get reported in Sentry when Turbolinks, Intercom, and Sentry are used together.

With any two there is no issue, but when all 3 are used at the same time in a default installation IE11 kicks off a "Can't execute code from a freed script" error on every mousemove event after the first Turbolinks page load.

I've spent well over 40 hours on this issue over the last 2 years with no success. I've torn apart Sentry and tried my best to tear apart and trace the Intercom widget code. We've mostly resorted to configuring Sentry to not report the error, but it's spotty and memory quickly becomes an issue which causes browser crashes.

The best I can tell so far is that Intercom doesn't seem to removeEventListeners in IE11 properly so Sentry still tries to run the wrapped listener on an object that's been destroyed. But, I could be wrong and just unable to trace it properly.

Steps to reproduce

I've built a vanilla rails app to isolate the issue. You can check it out here:
https://github.com/jhubert/sentry-intercom-turbolinks-issue

  1. Download that repo
  2. Get a sentry DSN
  3. Follow the instructions in the README

Help?

I would be more than happy to hop on Zoom to take someone through this if it would be helpful.

@jhubert
Copy link
Author

jhubert commented Jun 17, 2020

I had a conversation with support confirming this issue 10 weeks again. Any way I can help move this forward?

Artboard

@jhubert
Copy link
Author

jhubert commented Jul 15, 2020

Checking in here again. @sduquej Any insight into this or ways that I can help clarify?

@sduquej
Copy link
Member

sduquej commented Jul 15, 2020

Hey @jhubert, really appreciate the detail you've provided here and the repo with repro steps.
I won't have the bandwidth to look into this soon but I'm raising it with the team.

We had seen this error in our own setup (we also use Sentry) about a year ago but we made changes to it and there hasn't been an instance of it in 90+ days. Do you have many users still using IE11?

I know this isn't great but if you haven't already I'd suggest configuring Sentry to ignore this error so that it doesn't eat up your quota :-/ As far as I can tell, there's no detrimental UX other than the annoying error in the IE console. Does this match what you're seeing?

@jhubert
Copy link
Author

jhubert commented Oct 22, 2020

@sduquej Thanks for the follow up. Somehow I missed the notification.

We ignored it in Sentry a while ago. It still comes up as an issue when doing anything in browserstack due to memory overloads. Those listeners stack on top of each other without getting cleared because of Turbolinks. A few pages in and the site can get really slow on older computers. Disabling Intercom fixes it.

The majority of our desktop users are on IE11 because we sell an enterprise product to retailers who are generally not on the latest technologies.

We had seen this error in our own setup (we also use Sentry) about a year ago but we made changes to it and there hasn't been an instance of it in 90+ days

What changes did you make?

@jhubert
Copy link
Author

jhubert commented Jan 15, 2021

@sduquej Any follow up on this? I'd love to get some resolution. I have full control over sentry and turbolinks, but the intercom listeners seem to be the problem and I'm limited to what I can change there.

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