transistorsoft / transistorsoft/react-native-background-geolocation
Facing regular spikes on distance calculation
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 446
- PR merge metrics
- No merged PRs in 30d
Description
We're seeing odometer distance spikes on Android in production.
Actual routes of ~100–200 km are reporting odometer values in the thousands of km — one journey reported 9,397 km on a ~195 km drive. Attached are the map views of the recorded routes; the GPS trail itself is correct, only the odometer is wrong.
Looking at consecutive onLocation events, the odometer jumps forward by 5+ km thousands of times and goes negative an almost equal number of times, so it seems to oscillate rather than drift. Affected devices are realme RMX5250, realme RMX3842, samsung SM-M127G, iQOO I2126 and OnePlus CPH2793 (Android 13–16) — all manufacturers with aggressive background process management.
Our config:
{
reset: true,
geolocation: {
desiredAccuracy: DesiredAccuracy.High,
distanceFilter: 10,
stopTimeout: 1,
stationaryRadius: 15,
filter: {
policy: LocationFilterPolicy.Conservative,
useKalman: true,
kalmanProfile: KalmanProfile.Conservative,
trackingAccuracyThreshold: 50,
odometerAccuracyThreshold: 40,
maxImpliedSpeed: 40,
},
},
persistence: { persistMode: PersistMode.Location },
app: {
stopOnTerminate: false,
startOnBoot: true,
enableHeadless: true,
},
http: {
autoSync: true,
batchSync: true,
maxBatchSize: 50,
},
}
Start sequence is start() → changePace(true) → resetOdometer().
Can you help identify what would cause this? Happy to share raw event logs.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the consecutive onLocation events and the start() → changePace(true) → resetOdometer() sequence described in the report. Compare the odometer jumps and negative changes with the supplied device, Android-version, and filter configuration; raw event logs are needed to establish a reproducible cause and define the fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100