When setting items in session storage, null and undefined values were being set as strings "null", "undefined".
According to the existing logic in Storage.getItem, these values weren't intended to be stored in the first place. This check in Storage.getItem is never hit since every value pulled from storage are strings.
This caused an error in every API request made in #75. Calling Radar.setHost(apiHost) would set the url to be apiHost/undefined/... when it should've defaulted to apiHost/v1/...
Issue
When setting items in session storage,
null
andundefined
values were being set as strings"null"
,"undefined"
.According to the existing logic in
Storage.getItem
, these values weren't intended to be stored in the first place. This check inStorage.getItem
is never hit since every value pulled from storage are strings.https://github.com/radarlabs/radar-sdk-js/blob/2cc470776b8989bf5ae02e711056ecce7ec1f229/src/storage.js#L53-L64
This caused an error in every API request made in #75. Calling
Radar.setHost(apiHost)
would set the url to beapiHost/undefined/...
when it should've defaulted toapiHost/v1/...