moribvndvs / ng2-idle

Responding to idle users in Angular (not AngularJS) applications.
https://moribvndvs.github.io/ng2-idle
Apache License 2.0
315 stars 128 forks source link

Runtime error in StorageInterruptSource.filterEvent #55

Open taokakao opened 7 years ago

taokakao commented 7 years ago

Current behavior

ng2-idle fails with error:

ERROR TypeError: Cannot read property 'indexOf' of null at StorageInterruptSource.webpackJsonp../node_modules/@ng-idle/core/src/storageinterruptsource.js.StorageInterruptSource.filterEvent (storageinterruptsource.js:22) at SafeSubscriber.handler [as _next] (eventtargetinterruptsource.js:33) at SafeSubscriber.webpackJsonp../node_modules/rxjs/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:238) at SafeSubscriber.webpackJsonp../node_modules/rxjs/Subscriber.js.SafeSubscriber.next (Subscriber.js:185) at Subscriber.webpackJsonp../node_modules/rxjs/Subscriber.js.Subscriber._next (Subscriber.js:125) at Subscriber.webpackJsonp../node_modules/rxjs/Subscriber.js.Subscriber.next (Subscriber.js:89) at ThrottleTimeSubscriber.webpackJsonp../node_modules/rxjs/operator/throttleTime.js.ThrottleTimeSubscriber._next (throttleTime.js:93) at ThrottleTimeSubscriber.webpackJsonp../node_modules/rxjs/Subscriber.js.Subscriber.next (Subscriber.js:89) at handler (FromEventObservable.js:134) at ZoneDelegate.webpackJsonp../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:424)

Expected behavior

No such RTE.

Minimal reproduction of the problem with instructions

Failing on Chrome with code taken from ng2-idle examples:

idle.setIdle(5); idle.setTimeout(10 * 60); idle.setInterrupts(DEFAULT_INTERRUPTSOURCES); idle.onTimeout.subscribe(() => { console.log('timeout'); }); this.idle.watch();

Please tell us about your environment:

Os-x, Chrome (both latest).

vincent-cm commented 6 years ago

same here

marten-nilsson commented 6 years ago

Same here

jimguistwite commented 6 years ago

I was able to cause the problem during normal timeout processing if user clears the local storage for my app using "Clear browsing data" in chrome while the idle process is running. A local storage event is fired with no key.