facebook

timers in custom javascript can affect IDE – apparent bug

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #325364 Reply

    JohnWord
    Member

    so this is interesting. I think a bug perhaps – to be fixed for next release maybe?
    not many people may encounter it..

    My application has sensitive data that is pulled back and forth via web services.
    The application should not be left unattended..
    So I put a timer in my _CUSTOM.JS code that calls my log out web service and then goes to my LOGIN screen.
    i.e. an automatic log out after 15 minutes. The timer is reset with every screen/web service call, etc..
    This works great.

    However I noticed something interesting (almost amusing).

    If I have the MobiOne development environment (IDE) open, and have run the app in the simulator, then stopped the simulator..
    so I’m back only in the IDE, the timers are still apparently running in background.
    …when the fifteen minute is up, the IDE hangs – has to be killed off via task manager, etc.

    If you confirm also, suggest that when closing the simulator, it closes all timers as well.

    #325370 Reply

    support-michael
    Keymaster

    @GA33

    Interesting. I will discuss w/ the dev team. As you have indicated the timers in the jsengine continue to run following termination of the test center browser. I suspect we continue to maintain the emulator’s browser instance to save on on memory resources.

    To replicate this do I simple do a setTimeout() and then close Test Center before the timeout completes?

    #325377 Reply

    JohnWord
    Member

    right – easy to replicate….
    Have a button to call this funtion for example:

    varTimerInterval = setInterval(TimedOut, varTimerSpeed);
    where the variable varTimerSpeed is something like 120000 (= five minutes)

    and TimeOut is a function you want to perform later.

    then exit the simulator.. Later you will notice the IDE is frozen.

    #325379 Reply

    support-michael
    Keymaster

    @GA33

    I chatted with our webkit/jsengine dev. Apparently this is a known issue but you are the 1st to encounter it. It is news to me. The story is that our webkit implementation has some quirk that it fails to shutdown cleanly such as terminating timers. I added your post to a bug that is tracking this webkit issue.

    For the short term consider manually terminating the timers. You can open the Test Center’s DOM Inpector and access the javascript console from there. What I would do is:
    1) assign the timer(s) to variable(s)
    2) create a javascript function that will clear the timers
    3) from the javascript console call the function to clear the timers

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: timers in custom javascript can affect IDE – apparent bug

You must be logged in to post in the forum log in