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

Android long timer warning (Setting a timer for a long period ...) #15

Closed
RRMoelker opened this issue Aug 28, 2020 · 3 comments
Closed

Comments

@RRMoelker
Copy link

🐛 Bug Report

Using the backend on an Android device results in a warning:

Setting a timer for a long period of time, i.e. multiple minutes, is a performance and correctness issue on Android as it keeps the timer module awake, and timers can only be called when the app is in the foreground. See https://github.com/facebook/react-native/issues/12981 for more info.
(Saw setInterval with duration 3600000ms)

To Reproduce

Using a clean react native project:

  1. Install i18next, i18next-locize-backend and react-i18next.
  2. Add the following to App.js:
import LocizeBackend from 'i18next-locize-backend';
new LocizeBackend(null, {});

Expected behavior

Expect no warning when using this library. By either:

  1. not having a long timer, or
  2. suppressing the warning if it can be ignored, or
  3. having a option to disable the timer.

Your Environment

  • runtime version:
  • node v13.10.1
  • react-native 0.61.5
  • i18next version:
  • i18next-locize-backend 4.1.2
  • i18next 19.7.0
  • os: Mac
@adrai
Copy link
Member

adrai commented Aug 28, 2020

Try to set reloadInterval to false, this should disable the setInterval => https://github.com/locize/i18next-locize-backend/blob/master/lib/index.js#L148

@RRMoelker
Copy link
Author

Yes that works!

And sorry for the bother. I seem to have opened the issue in the wrong repo.

@adrai
Copy link
Member

adrai commented Aug 28, 2020

no problem ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants