Redux-saga: Bug on delay that happens on device but not on simulator

Created on 5 May 2017  路  3Comments  路  Source: redux-saga/redux-saga

The code below console.logs something each second. Works on simulator, but on device it console.logs hundreds or thousands of times.

import { delay } from 'redux-saga'
import { fork } from 'redux-saga/effects'

export function* doStuff () {
  while (true) {
    console.log('doStuff')
    yield delay(1000)
  }
}

export default function*() {
  yield [fork(doStuff)]
}

Device: iPhone 6s (iOS 10.3)
Redux-Saga: 0.14, 0.15
Redux: 3.5.2
React-Redux: 5.0.4
React Native: 0.43.3

Most helpful comment

I'm having the same issue using redux-saga with react-native. It just happens when using remote debug.

This comment on a related react-native issue has more information: https://github.com/facebook/react-native/issues/4470#issuecomment-302869193

All 3 comments

delay is literally a promise wrapper over setTimeout, you can check it out in the source code. Nothing changed regarding it and as its usage is quite common - you are the first one to file an issue.

Could you checl if your's environment setTimeout wasnt tampered with? Or could you reproduce your issue on something like webpackbin? Without this there is not much I can do to help you unfortunately.

Hi @Andarist, thanks.

I'll close this because after some hours losing my mind with it it just started working. Not sure what happened but it's probably not something in redux-saga's end.

I'll come back at this to see if I'm able to find the root cause.

I'm having the same issue using redux-saga with react-native. It just happens when using remote debug.

This comment on a related react-native issue has more information: https://github.com/facebook/react-native/issues/4470#issuecomment-302869193

Was this page helpful?
0 / 5 - 0 ratings

Related issues

neurosnap picture neurosnap  路  3Comments

NullVoxPopuli picture NullVoxPopuli  路  3Comments

stevenmusumeche picture stevenmusumeche  路  3Comments

fdesrosiers picture fdesrosiers  路  3Comments

sompylasar picture sompylasar  路  3Comments