Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requestIdleCallback may never fire again after app is backgrounded #17645

Closed
berickson1 opened this issue Jan 18, 2018 · 3 comments
Closed

requestIdleCallback may never fire again after app is backgrounded #17645

berickson1 opened this issue Jan 18, 2018 · 3 comments
Labels
Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@berickson1
Copy link
Contributor

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Latest Expo App: SDK 24
Target Platform: Android 7.0

Steps to Reproduce

  1. Run Expo Sample https://snack.expo.io/r1HW4J0EG
  2. Background Expo Sample
  3. Foreground Expo Sample

This occurs if I always maintain at least one setIdleCallback queued at the time the app is backgrounded.

Expected Behavior

Counter continues to increment

Actual Behavior

Counter stops running

Reproducible Demo

https://snack.expo.io/r1HW4J0EG

export default class App extends Component {
  doIdleWork() {
    requestIdleCallback(() => {
      this.setState({number: this.state ? this.state.number +1 : 0 });
      // setup another requestIdleCallback before we're done
      this.doIdleWork();
    });
  }
  componentDidMount() {
    this.state = { number:1 };
    this.doIdleWork();
  }
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.paragraph}>
         {this.state ? this.state.number : 0 }
        </Text>
        <Card title="Local Modules">
          <AssetExample />
        </Card>
      </View>
    );
  }
}
@berickson1
Copy link
Contributor Author

Still occurring on ReactNative 25
Update expo link:
https://snack.expo.io/BkvefsqUM

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

How to ContributeWhat to Expect from Maintainers

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon. labels Feb 24, 2018
@salmanwaheed
Copy link

salmanwaheed commented Feb 24, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

3 participants