uken / newrelic-timing

Integrates Single Page Apps with NewRelic's Real User Monitoring
Apache License 2.0
100 stars 17 forks source link

Weird issues after integration. #5

Closed Gonzih closed 9 years ago

Gonzih commented 9 years ago

Hi, I tried to integrate this plugin to my app, but after that rendering become broken on page. After I click any link url changes, but page does not change at all. All interactive popups work fine, but only full page load is failing. Of course since url changes after refreshing page everything is fine. Do you have any ideas why this might be happening?

Thanks.

pitr commented 9 years ago

Any errors in your javascript log?

Gonzih commented 9 years ago

No, everything is clear in log.

On 08/05/2014 06:44 PM, ☃ pitr wrote:

Any errors in your javascript log?

— Reply to this email directly or view it on GitHub https://github.com/uken/newrelic-timing/issues/5#issuecomment-51225134.

pitr commented 9 years ago

is there anything else you can tell me? this is really hard to debug :)

Gonzih commented 9 years ago

It feels like plugin overrides default behaviour for all a tags. It's can fixed by adding target="_self". On Aug 6, 2014 4:08 PM, "☃ pitr" notifications@github.com wrote:

is there anything else you can tell me? this is really hard to debug :)

— Reply to this email directly or view it on GitHub https://github.com/uken/newrelic-timing/issues/5#issuecomment-51339067.

pitr commented 9 years ago

This plugin only listens on events from inside angular, specifically $routeChangeStart, $routeChangeSuccess and $viewContentLoaded. Apart from calling methods inside NewRelic's injected NREUM, it doesn't have any side effects.

Gonzih commented 9 years ago

Does order of injection matters for this plugin? On Aug 6, 2014 4:53 PM, "☃ pitr" notifications@github.com wrote:

This plugin only listens on events from inside angular, specifically $routeChangeStart, $routeChangeSuccess and $viewContentLoaded. Apart from calling methods inside NewRelic's injected NREUM, it doesn't have any side effects.

— Reply to this email directly or view it on GitHub https://github.com/uken/newrelic-timing/issues/5#issuecomment-51345609.

pitr commented 9 years ago

newrelic-timing.js and newrelic-timing-angular.js need to load before you use them in your angular app

Gonzih commented 9 years ago

I mean how you refer it inside app. Should it be first item? On Aug 6, 2014 5:24 PM, "☃ pitr" notifications@github.com wrote:

newrelic-timing.js and newrelic-timing-angular.js need to load before you use them in your angular app

— Reply to this email directly or view it on GitHub https://github.com/uken/newrelic-timing/issues/5#issuecomment-51350266.

pitr commented 9 years ago

that shouldn't matter

Gonzih commented 9 years ago

Ok. Thanks. I will investigate this issue more during next few days. Cheers! On Aug 6, 2014 5:37 PM, "☃ pitr" notifications@github.com wrote:

that shouldn't matter

— Reply to this email directly or view it on GitHub https://github.com/uken/newrelic-timing/issues/5#issuecomment-51352293.

Gonzih commented 9 years ago

So looks like it works only when I remove $location from this code section https://github.com/uken/newrelic-timing/blob/master/src/newrelic-timing-angular.js#L12-L34

Gonzih commented 9 years ago

I ended up reimplementing angular specific bindings on my own using NewrelicTiming class. One thing that I noticed that $rootScope.$on('$viewContentLoaded') dose not work, but $rootScope.$watch works fine.

pitr commented 9 years ago

what version of angular are you using?

pitr commented 9 years ago

What do you mean by $rootScope.$watch? This - $rootScope.$watch('$viewContentLoaded')? It's an event - https://github.com/angular/angular.js/search?q=%24viewContentLoaded

Gonzih commented 9 years ago

Yes, I know. But it does not work with $on listener. Angular version is v1.2.18

On Tue, Aug 19, 2014 at 07:48:35AM -0700, ☃ pitr wrote:

What do you mean by $rootScope.$watch? This - $rootScope.$watch('$viewContentLoaded')? It's an event - https://github.com/angular/angular.js/search?q=%24viewContentLoaded


Reply to this email directly or view it on GitHub: https://github.com/uken/newrelic-timing/issues/5#issuecomment-52645141

Best regards, Max

pitr commented 9 years ago

Can you share your reimplementation of those bindings?

Gonzih commented 9 years ago

They are just event listeners for internal events in my app. I don't use ngRouter, but some weird hybrid that evolved over time in to the state/url management factory. I still can't figure out why injecting your module was causing such strange behaviour.

On Wed, Aug 20, 2014 at 11:20:48AM -0700, ☃ pitr wrote:

Can you share your reimplementation of those bindings?


Reply to this email directly or view it on GitHub: https://github.com/uken/newrelic-timing/issues/5#issuecomment-52819445

Best regards, Max

pitr commented 9 years ago

Does your custom router use any of the events we use? $routeChangeStart, $routeChangeSuccess, $stateChangeStart, $stateChangeSuccess, $viewContentLoaded

Gonzih commented 9 years ago

Only viewContentLoaded with "watch" instead of "on" which surprisingly works.

— Regards, Max

On Thu, Aug 21, 2014 at 5:24 PM, ☃ pitr notifications@github.com wrote:

Does your custom router use any of the events we use? $routeChangeStart, $routeChangeSuccess, $stateChangeStart, $stateChangeSuccess, $viewContentLoaded

Reply to this email directly or view it on GitHub: https://github.com/uken/newrelic-timing/issues/5#issuecomment-52935773

pitr commented 9 years ago

that is quite odd, but seems to be very much related to your custom router. This module officially support ngRouter and ui-router