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

fix(app): Grab intercom handler from window on every call #2179

Merged
merged 1 commit into from
Sep 4, 2018

Conversation

mcous
Copy link
Contributor

@mcous mcous commented Sep 4, 2018

overview

Bug report + fix.

Our support module was caching the intercom handler too early (before the window had a chance to load, which is when the Intercom snippet actually assigns to window.Intercom), resulting in all our intercom calls nooping. This change removes the caching so window.Intercom is always
called correctly (as suggested by @IanLondon)

changelog

  • fix(app): Grab intercom handler from window on every call

review requests

When you connect to a robot, you should see the "Robot Name" field of your intercom user update to that name. Hit me up over Slack for the correct intercom ID to use.

make -C app dev OT_APP_INTERCOM_ID=xyz123

Our support module was caching the intercom handler too early (before
the window had a chance to load), resulting in all our intercom calls
nooping. This change removes the caching so window.Intercom is always
called correctly.
@mcous mcous added bug app Affects the `app` project ready for review fix PR fixes a bug labels Sep 4, 2018
@mcous mcous requested review from b-cooper and IanLondon September 4, 2018 15:02
Copy link
Contributor

@IanLondon IanLondon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -32,9 +37,8 @@ export const supportMiddleware: Middleware = (store) => (next) => (action) => {
if (action.type === 'robot:CONNECT_RESPONSE') {
const state = store.getState()
const robot = state.robot.connection.connectRequest.name
const data = {user_id: userId, 'Robot Name': robot}
log.debug('Updating intercom data', {data})
intercom('update', {data})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an uncaught bug because intercom was always nooping; it should've been intercom('update', data)

@mcous mcous merged commit a90aaae into edge Sep 4, 2018
@mcous mcous deleted the app_fix-intercom-handler branch September 4, 2018 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Affects the `app` project bug fix PR fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants