Skip to content

Bug/Problem with setTimeout function #12820

@ibrahimAboelsuod

Description

@ibrahimAboelsuod

Ionic version:
[ ] 1.x
[ ] 2.x
[x] 3.x

I'm submitting a
[x] bug report
[ ] feature request
[ ] support request

Current behavior:
setTimeout() always wait for about an extra second despite what ever time I set.

Expected behavior:
The function to only wait the duration I set or at least close enough to it.

Steps to reproduce:
1- Create a blank app.
2- Use setTimeout() with any time less than 1 second -to notice the problem easier.

Related code:

console.log('Timer Start');
let timeOutHandler = setTimeout(
    ()=>{
        console.log('Timer End');
    },
    100
);

Other information:

  • I am using setTimeout() to keep track of some user events -like scroll ending-, which worked as expected (executed a function after a set time of milliseconds).

  • A few days ago I updated my device WebView to the latest version. Immediately after the function stopped working correctly. (tested on 60.0.3112.107 & 60.0.3112.116)

  • Didn't get the same issue with a blank Cordova app.

  • I tested the function in different parts/pages of the app.

  • I tested on 3 android devices with the same results.

  • The problem only appears in the latest WebView update (maybe slightly earlier updates too).

  • The tests where done in blank apps.

  • Of course the code above was written by JavaScript for the cordova app.

My post on the forums with more info + screenshots

Ionic info: (For the blank app):

cli packages:

    @ionic/cli-utils  : 1.6.0 (C:\Users\iaboelsuod\AppData\Roaming\npm\node_modules\ionic\node_modules\@ionic\cli-utils)
    ionic (Ionic CLI) : 3.6.0 (C:\Users\iaboelsuod\AppData\Roaming\npm\node_modules\ionic)

System:

    Android SDK Tools : 26.0.2
    Node              : v6.11.0
    OS                : Windows 10
    npm               : 3.10.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions