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

Watch intervals should be run outside of main Angular zone #40

Closed
b-hobbs opened this issue Feb 21, 2017 · 6 comments
Closed

Watch intervals should be run outside of main Angular zone #40

b-hobbs opened this issue Feb 21, 2017 · 6 comments

Comments

@b-hobbs
Copy link

b-hobbs commented Feb 21, 2017

I'm submitting a ... (check one with "x")

[ x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/HackedByChinese/ng2-idle/blob/master/CONTRIBUTING.md#getting-help

Current behavior

ng2-idle's watching uses setInterval on the main angular zone which is blocking Protractor because it waits until all calls in the main zone are finished.

Expected behavior

setInterval is run outside of the main angular zone so that it doesn't block Protractor.

Minimal reproduction of the problem with instructions

You should be able to add protractor to an app setup for ng2-idle and use protractor --elementExplorer and try to grab an element through Protractor's api.

Workaround
Should preferably deal with this inside of the plugin itself.

    this._ngZone.runOutsideAngular(() => {
      this.idle.watch();
    });

    this.idle.onTimeoutWarning.subscribe((countdown: number) => {
      this._ngZone.run(() => { this.sessionEndCountdown = countdown });
    });

What is the motivation / use case for changing the behavior?

Protractor tests don't work

Please tell us about your environment:

OSX EL Capitan 10.11.6
VS Code

  • @ng-idle version: 2.x

2.0.0-beta.4

  • Angular version: 2.x

2.4.7

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

ALL

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    ALL

  • Node: node --version =
    7

@xtazy
Copy link

xtazy commented Feb 24, 2017

Same problem.

@santonica
Copy link

I provided a solution in SO for this and then found this open defect. Please fix this within the ng2-idle. Thx @b-hobbs for opening this issue.

@jmurphy87
Copy link

still experiencing this issue, any solutions yet?

@tiboprea
Copy link

Any updates on this issue?

@moribvndvs
Copy link
Owner

Closed via #74

@veneliniliev
Copy link

i have same problem with version 7.0.0-beta.1

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

7 participants