From 6f86950c265d7e4afab6b05e91204bed0bcbc83e Mon Sep 17 00:00:00 2001 From: Nick Patrick Date: Tue, 26 Nov 2024 03:36:17 -0500 Subject: [PATCH 1/2] change location timeout to 10 seconds, catch trackVerified() errors in startTrackingVerified() --- README.md | 14 +++++++------- package-lock.json | 2 +- package.json | 2 +- src/api/verify.ts | 9 +++++++-- src/navigator.ts | 2 +- src/version.ts | 2 +- 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index b492cfeb..6eb14a71 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Radar.initialize('prj_test_pk_...', { /* options */ }); Add the following script in your `html` file ```html - + ``` Then initialize the Radar SDK @@ -73,8 +73,8 @@ To create a map, first initialize the Radar SDK with your publishable key. Then ```html - - + + @@ -98,8 +98,8 @@ To create an autocomplete input, first initialize the Radar SDK with your publis ```html - - + + @@ -130,8 +130,8 @@ To power [geofencing](https://radar.com/documentation/geofencing/overview) exper ```html - - + + diff --git a/package-lock.json b/package-lock.json index ff37efb3..92f02483 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "radar-sdk-js", - "version": "4.4.7", + "version": "4.4.8", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index cab052c1..9f0b3fd3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "radar-sdk-js", - "version": "4.4.7", + "version": "4.4.8", "description": "Web Javascript SDK for Radar, location infrastructure for mobile and web apps.", "homepage": "https://radar.com", "type": "module", diff --git a/src/api/verify.ts b/src/api/verify.ts index 7c5cff9c..894ed3b5 100644 --- a/src/api/verify.ts +++ b/src/api/verify.ts @@ -116,8 +116,13 @@ class VerifyAPI { static async startTrackingVerified(params: RadarStartTrackingVerifiedParams) { const doTrackVerified = async () => { - const trackRes = await this.trackVerified(params); - + let trackRes; + try { + trackRes = await this.trackVerified(params); + } catch { + + } + const { interval } = params; let expiresIn = 0; diff --git a/src/navigator.ts b/src/navigator.ts index d09692cd..050d6d58 100644 --- a/src/navigator.ts +++ b/src/navigator.ts @@ -11,7 +11,7 @@ interface PositionOptionOverrides { const DEFAULT_POSITION_OPTIONS: PositionOptions = { maximumAge: 0, - timeout: 1000 * 30, // 30 seconds + timeout: 1000 * 10, // 10 seconds enableHighAccuracy: true, }; diff --git a/src/version.ts b/src/version.ts index f0b1a813..aedeb33a 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export default '4.4.7'; \ No newline at end of file +export default '4.4.8'; \ No newline at end of file From 9e2c6f1ffa3412b9497106913d84c164add5ef50 Mon Sep 17 00:00:00 2001 From: Nick Patrick Date: Tue, 26 Nov 2024 03:38:05 -0500 Subject: [PATCH 2/2] add logging --- src/api/verify.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/verify.ts b/src/api/verify.ts index 894ed3b5..9bcb6107 100644 --- a/src/api/verify.ts +++ b/src/api/verify.ts @@ -119,8 +119,8 @@ class VerifyAPI { let trackRes; try { trackRes = await this.trackVerified(params); - } catch { - + } catch (err: any) { + Logger.error(`trackVerified error: ${err.message}`); } const { interval } = params;