angular-scroll icon indicating copy to clipboard operation
angular-scroll copied to clipboard

Guard against last minute removal of toBeActive spy

Open pkaminski opened this issue 8 years ago • 4 comments

Since the broadcast of becameInactive is synchronous, it's possible for the toBeActive spy to be removed by client code just before it gets activated. This change guards against this (admittedly extremely rare) scenario by treating the spy as if though it didn't exist in the first place. Note that it's possible that another spy should've been selected instead, then, but since the condition is so rare it's probably OK to wait until the next interval fires to recompute the actual active spy.


This change is Reviewable

pkaminski avatar May 23 '16 10:05 pkaminski

Thanks for your PR! Can you look into why the test is failing?

oblador avatar May 23 '16 10:05 oblador

I'm mystified at the failing tests. They all pass on my machine (against Chrome 50), and the failure appears to be in an area completely unrelated to the change I made (a context can't be found). Is it possible to force the tests to rerun, in case this is some kind of transient?

pkaminski avatar May 23 '16 10:05 pkaminski

Reran with same results, I'll have to look into the errors which might be unrelated. Can I ask you to follow the style and put the statement in { }?

oblador avatar May 23 '16 12:05 oblador

Oops, fixed. The joys of working on multiple projects with different styles. :stuck_out_tongue_closed_eyes:

pkaminski avatar May 23 '16 20:05 pkaminski