Skip to content

Race condition in the javascript code #107

@danielegobbetti

Description

@danielegobbetti

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions