radarlabs / radar-sdk-js

Web JavaScript SDK for Radar, the leading geofencing and location tracking platform
https://radar.com
Apache License 2.0
42 stars 11 forks source link

RAD-5740: cache-recent-locations-in-websdk-with-variable-ttl #86

Closed boonboonsiri closed 1 year ago

boonboonsiri commented 1 year ago

Requirements

Difficult to write test for. Tested manually:

QA details

Include screenshots, responses, or steps to verify the code works as expected

Can verify locally by setting up local sdk, or verify that it works using vercel:

https://frontend-git-boon-sdk-demo-branch-radarlabs.vercel.app/demo/js

Currently cached location time is 30 seconds. So go to link in safari, enter prompt for location.

After you can continuously reload for up to 30 seconds without being re-prompted for your location, but then after 30 seconds you'll get prompted again

I probably should have just installed loom on safari but here we are:

https://youtu.be/VU5nAQ74pyo

docs: https://github.com/radarlabs/documentation/pull/232

boonboonsiri commented 1 year ago

Ask about which branch to merge this into

boonboonsiri commented 1 year ago

You can get prompted like after which I believe is intended

boonboonsiri commented 1 year ago

Note time to live specifically exists for Track.trackOnce and not for all location request. Not that difficult to set this up for all location request (just need to move code)

boonboonsiri commented 1 year ago

Okay changes made. Back at you @kochis

boonboonsiri commented 1 year ago

Back at you @corypisano

corypisano commented 1 year ago

cool i'll bump the sdk version, and just gonna fix some formatting (we should bring lint setup here but separate issue)