intercom-rails icon indicating copy to clipboard operation
intercom-rails copied to clipboard

Path generation occasionally creates relative and throws an error

Open jathayde opened this issue 6 years ago • 0 comments

Version info

  • intercom-rails version: 0.3.5
  • Rails version: 5.1.5

Expected behavior

Intercom should create a header that loads a javascript file from the root

Actual behavior

Intermittently, the gem renders a path such as this:

https://www.patchvault.org/lodges/168b-kuskitannee/issue_sets/intercom.js

and the error (as it's trying to look up a record with that :id)

ActiveRecord::RecordNotFound: Couldn't find IssueSet with 'id'=intercom app/controllers/issue_sets_controller.rb:13:in `show'

When it renders correctly, the head contains:

<script type="text/javascript" async="" src="https://widget.intercom.io/widget/bni1h8ib"></script>

Steps to reproduce

  1. Install the gem
  2. Run it on an app with polymorphic nested routes
  3. wait for it to fail

Logs

Have AppSignal captures on this, but nothing more. If there's something in particular that would help, let me know.

jathayde avatar Mar 20 '18 13:03 jathayde