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

Race condition in the javascript code #107

Open
danielegobbetti opened this issue Apr 7, 2017 · 0 comments
Open

Race condition in the javascript code #107

danielegobbetti opened this issue Apr 7, 2017 · 0 comments

Comments

@danielegobbetti
Copy link

danielegobbetti commented Apr 7, 2017

I believe there is a race condition in the JS code, that yields to https://github.com/Freeyourgadget/Gadgetbridge/issues/643 .

Specifically I am referring to this function.

If the localstorage key "disable_weather" is set to "yes", and the locationError gets called, the following happens:

  1. updateWeather() gets called by the ready event listener
  2. if weatherLoc is false, getLocation() is called
  3. if the current position returns error locationError gets called
  4. updateWeather() is called before incrementing currentFailures
  5. GOTO 1 (oh, the good basic times :-) )

h/t @LucaRainone for the help in diagnosing

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

1 participant