Skip to content

[iOS] setInterval fire improperly after set system time to the past #11732

Closed

Description

@TAUnionOtto

Hi,

Description

Do:

setInterval(() => { console.warn('fire') }, 5 *1000);

It will warn 'fire' every 5 seconds,
But if you set system time to the past in Setting, than switch back to your app, warning would stop

For example, set time 1 min slow, 15:50 -> 15:49
'Fire' will show after about 1 min.
It means that if you change system time manually or automatically by system , all JSTimer will be confusion

But if you set time to the future, or change time in Android, it works well.

In iOS, RCTTimer._target = [NSDate dateWithTimeIntervalSinceNow:targetTime]
And if you change system time, _target will not change,
_sleepTimer.fireDate will not change, either.

Additional Information

  • React Native version: 0.35.0
  • Platform: iOS

Activity

  1. changed the title [-][iOS] setInterval fire improperly after set system time slow[/-] [+][iOS] setInterval fire improperly after set system time to the past[/+] on Jan 6, 2017
  2. hramos commented on May 25, 2017

    @hramos
    Contributor

    We're cutting down on the number of outstanding issues, in order to allow us to focus. I'm closing this issue because it has been open for over 60 days with no activity. If you think it should still be opened let us know why. PRs are always welcome.

  3. locked as resolved and limited conversation to collaborators on May 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions