Skip to content

fix: history not working due to a failed getDistance function from geolib#186

Merged
aeharding merged 2 commits intoaeharding:mainfrom
littlefreak3000:main
May 2, 2026
Merged

fix: history not working due to a failed getDistance function from geolib#186
aeharding merged 2 commits intoaeharding:mainfrom
littlefreak3000:main

Conversation

@littlefreak3000
Copy link
Copy Markdown
Contributor

I fixed this by removing the package all together and simply adding a haversine distance formula. Tested and don't find any issue of locations being added to the list twice which seemed to be the goal of this distance check.

…by external package. Removed the package and added a new getDistance function.
@aeharding aeharding changed the title Fixed history not working due to a failed getDistance function from external package. fix: history not working due to a failed getDistance function from geolib May 2, 2026
- Extract haversine getDistance into src/helpers/geo.ts with a LatLon
  interface so it can be reused outside user storage.
- Fix findLocation, which passed GeolocationCoordinates (latitude/
  longitude) to a function typed for UserLocation (lat/lon), causing
  a TS error and NaN distances at runtime.
- Add unit tests for getDistance.
- Reformat storage.ts to satisfy prettier.
@aeharding aeharding merged commit 56358a3 into aeharding:main May 2, 2026
1 check passed
@aeharding
Copy link
Copy Markdown
Owner

Great catch, thank you!

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

Successfully merging this pull request may close these issues.

2 participants