transistorsoft / react-native-background-geolocation

Sophisticated, battery-conscious background-geolocation with motion-detection
http://shop.transistorsoft.com/pages/react-native-background-geolocation
MIT License
2.54k stars 424 forks source link

Got multiple records (latitude, longtitude and timestamp ) when user switching between internet connections #1969

Closed Nishad013 closed 1 week ago

Nishad013 commented 1 month ago

Your Environment

System: OS: macOS 14.4 CPU: (8) arm64 Apple M2 Memory: 122.48 MB / 8.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 16.20.2 - ~/.nvm/versions/node/v16.20.2/bin/node Yarn: 1.22.21 - ~/Documents/GitHub/alt-tomrex-app/node_modules/.bin/yarn npm: 8.19.4 - ~/.nvm/versions/node/v16.20.2/bin/npm Watchman: 2024.01.22.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.15.0 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 23.2, iOS 17.2, macOS 14.2, tvOS 17.2, visionOS 1.0, watchOS 10.2 Android SDK: Not Found IDEs: Android Studio: 2023.1 AI-231.9392.1.2311.11330709 Xcode: 15.2/15C500b - /usr/bin/xcodebuild Languages: Java: 15.0.2 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: ^0.64.0 => 0.64.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Expected Behavior

when the application has stable network connection then it sync location to configured url with every entry it gets from device and lock any duplicate entry in SQlite

Actual Behavior

while testing the application in release mode we have encounter an problem where we get multiple records with same (latitude, longtitude and timestamp ) in database and this problem occurs when the user is switching the internet connection on every 100-200 meter walk like user walk 200 meter with cellular connection on and after 200 meter walk it off . this process is repeated 4-5 times .

Steps to Reproduce

  1. just try switching between cellular network repeatedly (if anyone face the same and resolved it please let me know ) image_2024_03_18T07_12_59_782Z

Context

we want to track the person location

Debug logs

As im tested this in release mode so i didn't get any logs

christocracy commented 1 month ago

The plug-in emits an onProviderChange event each time the location provider changes. The plug-in also records a location with event: “providerchange". Some apps like to know where/when a user might have disabled location-services.

this can be disabled (see api docs Config.disableProviderChangeRecord).

Nishad013 commented 1 month ago

Okay i got it what you are trying to say just tell me if i'm not getting it wrong let i switch off the internet at 9:15:00am till 9:25:00am then it has to record the data when the internet connection is switched like 9:15:00am only and not for whole time till the connection is switched of RIGHT? ONLY 9:15:00am record has to come twice not the records from 9:15:00am to 9:25:00am CORRECT ME IF I'm WRONG

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 week ago

This issue was closed because it has been inactive for 14 days since being marked as stale.