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

Geolocation.watchPosition() almost always call the callback passed to it two times instantly #2177

Open
JulienLecoq opened this issue Aug 19, 2024 · 0 comments

Comments

@JulienLecoq
Copy link

Bug Report

Plugin(s)

@capacitor/geolocation: "^6.0.1"

Capacitor Version

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 6.1.2
  @capacitor/core: 6.1.2
  @capacitor/android: 6.1.2
  @capacitor/ios: 6.1.2

Installed Dependencies:

  @capacitor/android: not installed
  @capacitor/ios: not installed
  @capacitor/cli: 6.1.2
  @capacitor/core: 6.1.2

Platform(s) affected

WEB, I didn't check if this also affects the other platforms.

Current Behavior

The call to Geolocation.watchPosition() almost always call the callback passed to it two times instantly, and often the two calls have the same position (same timestamp).

Expected Behavior

It should call the callback just once or at least, never give two times the same position.

Code Reproduction

https://github.com/JulienLecoq/bug_watching_position

Other Technical Details

npm --version: 10.7.0
node --version: v20.14.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants