kochis Github contribution chart
kochis Github Stats
kochis Most Used Languages

Activity

04 Oct 2022

Kochis

Hotfix null and undefined check for session storage

Issue

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.

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 be apiHost/undefined/... when it should've defaulted to apiHost/v1/...

Merged On 04 Oct 2022 at 05:56:37

Kochis

Commented On 04 Oct 2022 at 05:56:37

Kochis

Hotfix null and undefined check for session storage

Issue

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.

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 be apiHost/undefined/... when it should've defaulted to apiHost/v1/...

Merged On 04 Oct 2022 at 05:30:19

Kochis

Commented On 04 Oct 2022 at 05:30:19

Kochis

Hotfix null and undefined check for session storage

Issue

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.

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 be apiHost/undefined/... when it should've defaulted to apiHost/v1/...

Merged On 04 Oct 2022 at 04:57:06

Kochis

Commented On 04 Oct 2022 at 04:57:06

Kochis

Use BASE_API_PATH for all endpoints in JS SDK

Story details: https://app.shortcut.com/radarlabs/story/12086

All tests pass

 Context
    getContext
      location permissions denied
        ✓ should throw a navigation error
      location permissions approved
        ✓ should return a context response

  Geocoding
    geocode
      ✓ should return an address
    reverseGeocode
      location permissions denied
        ✓ should propagate the navigator error
      location permissions approved
        ✓ should return a geocode response
    ipGeocode
      ✓ should return a geocode response

  Routing
    getDistanceToDestination
      location permissions denied
        ✓ should throw a navigation error
      location permissions approved
        no args given
          ✓ should return a routing response
        all args given
          ✓ should return a routing response
    getMatrixDistances
      location permissions denied
        ✓ should throw a navigation error
      location permissions approved
        no args given
          ✓ should return a routing response
        all args given
          ✓ should return a routing response

  Search
    searchPlaces
      location permissions denied
        ✓ should propagate the navigator error
      location permissions approved
        ✓ should return a placeSearch response
      location is given
        ✓ should return a placeSearch response
    searchGeofences
      location permissions denied
        ✓ should propagate the navigator error
      location permissions approved
        ✓ should return a geofenceSearch response
      location is given
        ✓ should return a geofenceSearch response
    autocomplete
      params are not provided
        ✓ should have undefined params and return an autocomplete response
      params are provided
        ✓ should return an autocomplete response

  Track
    trackOnce
      location permissions denied
        ✓ should propagate the navigator error
      location permissions approved
        ✓ should return a track response with metadata
        ✓ should return a track response without metadata

  Trips
    startTrip
      called without tripOptions
        ✓ should include tripOptions each set to unknown
        ✓ should include tripOptions
    updateTrip
      called without status
        ✓ should include status unknown
      called with status
        ✓ should include status

  Device
    getId
      deviceId has not been set
        ✓ should generate a new deviceId in storage, and return the value
      deviceId has already been set
        ✓ should return the deviceId stored saved in the storage

  Http
    http requests
      success
        ✓ should return api response on success
        ✓ should always include Device-Type and SDK-Version headers
        ✓ should filter out undefined values in data
      error
        ✓ should return bad request error
        ✓ should return bad request error
        ✓ should return unauthorized error
        ✓ should return payment required error
        ✓ should return forbidden error
        ✓ should return not found error
        ✓ should return rate limit error
        ✓ should return server error
        ✓ should return unknown error
        ✓ should respond with server error status on request error
        ✓ should respond with network error status on timeout
        ✓ should return a publishable key error if not set
        ✓ should return a server error on invalid JSON
    GET request
      ✓ should inject GET parameters into the url querystring
      ✓ should not append querystring of no params
    custom headers
      ✓ should include headers in request

  Radar
    VERSION
      ✓ should return sdk version
    STATUS
      ✓ should return the list of possible status codes
    initialize
      no publishable key given
        ✓ should print a warning to the console
      called with publishable key
        ✓ should save publishable key to storage
    setHost
      ✓ should save the host to storage
    setUserId
      no userId given
        ✓ should delete userId from storage
      userId given
        ✓ should save userId in storage
    setDeviceId
      no deviceId given
        ✓ should delete deviceId from storage
      deviceId given
        ✓ should save deviceId in storage
        ✓ should save deviceId with installId in storage
    setDescription
      no description given
        ✓ should delete description from storage
      description given
        ✓ should save description in storage
    setMetadata
      no metadata given
        ✓ should delete metadata from storage
      metadata given
        ✓ should save metadata in storage
    setRequestHeaders
      no headers given
        ✓ should delete metadata from storage
      headers given
        ✓ should save metadata in storage
    api errors
      Radar error
        ✓ should return the error enum and empty object
      Http Error
        ✓ should return the error enum and response object
      Unknown
        ✓ should return the unknown error and empty object
    getLocation
      ✓ should propagate the err if not successful
      ✓ should succeed
    trackOnce
      ✓ should call trackOnce if the first arg is a callback
      ✓ should call trackOnce if the first arg is a location object
      ✓ should not throw an error if no callback given
    getContext
      ✓ should call getContext if the first arg is a callback
      ✓ should call getContext if the first arg is a location
    searchPlaces
      ✓ should call searchPlaces
    searchGeofences
      ✓ should call searchGeofences
    autocomplete
      ✓ should call autocomplete
    geocode
      ✓ should call geocode
    reverseGeocode
      ✓ should call reverseGeocode if the first arg is a callback
      ✓ should call reverseGeocodeLocation if the first arg is a location object
    ipGeocode
      ✓ should call ipGeocode if the first arg is a callback
      ✓ should call ipGeocode is the first arg is an object
    getDistance
      ✓ should call getDistanceToDestination

  Navigator
    ✓ should report a location error if geolocation is not available
    ✓ should report a location error if position coordinates are not available
    ✓ should report a permissions error if the user denies location permissions
    ✓ should report a location error if the device errors out fetching location
    ✓ should succeed

  Storage
    getItem
      ✓ should return value of sessionStorage from a given key
      ✓ should return null if key not found
      ✓ should return null if sessionStorage key is undefined
    setItem
      ✓ should write the key and value to the browsers sessionStorage
    clear & removeItem
      ✓ should delete session Storage
      ✓ should clear session storage

  VERSION
    ✓ should match version in package.json
    ✓ should match version in package-lock.json


  96 passing (87ms) 

Merged On 03 Oct 2022 at 08:36:28

Kochis

Commented On 03 Oct 2022 at 08:36:28

Kochis

Use BASE_API_PATH for all endpoints in JS SDK

Story details: https://app.shortcut.com/radarlabs/story/12086

All tests pass

 Context
    getContext
      location permissions denied
        ✓ should throw a navigation error
      location permissions approved
        ✓ should return a context response

  Geocoding
    geocode
      ✓ should return an address
    reverseGeocode
      location permissions denied
        ✓ should propagate the navigator error
      location permissions approved
        ✓ should return a geocode response
    ipGeocode
      ✓ should return a geocode response

  Routing
    getDistanceToDestination
      location permissions denied
        ✓ should throw a navigation error
      location permissions approved
        no args given
          ✓ should return a routing response
        all args given
          ✓ should return a routing response
    getMatrixDistances
      location permissions denied
        ✓ should throw a navigation error
      location permissions approved
        no args given
          ✓ should return a routing response
        all args given
          ✓ should return a routing response

  Search
    searchPlaces
      location permissions denied
        ✓ should propagate the navigator error
      location permissions approved
        ✓ should return a placeSearch response
      location is given
        ✓ should return a placeSearch response
    searchGeofences
      location permissions denied
        ✓ should propagate the navigator error
      location permissions approved
        ✓ should return a geofenceSearch response
      location is given
        ✓ should return a geofenceSearch response
    autocomplete
      params are not provided
        ✓ should have undefined params and return an autocomplete response
      params are provided
        ✓ should return an autocomplete response

  Track
    trackOnce
      location permissions denied
        ✓ should propagate the navigator error
      location permissions approved
        ✓ should return a track response with metadata
        ✓ should return a track response without metadata

  Trips
    startTrip
      called without tripOptions
        ✓ should include tripOptions each set to unknown
        ✓ should include tripOptions
    updateTrip
      called without status
        ✓ should include status unknown
      called with status
        ✓ should include status

  Device
    getId
      deviceId has not been set
        ✓ should generate a new deviceId in storage, and return the value
      deviceId has already been set
        ✓ should return the deviceId stored saved in the storage

  Http
    http requests
      success
        ✓ should return api response on success
        ✓ should always include Device-Type and SDK-Version headers
        ✓ should filter out undefined values in data
      error
        ✓ should return bad request error
        ✓ should return bad request error
        ✓ should return unauthorized error
        ✓ should return payment required error
        ✓ should return forbidden error
        ✓ should return not found error
        ✓ should return rate limit error
        ✓ should return server error
        ✓ should return unknown error
        ✓ should respond with server error status on request error
        ✓ should respond with network error status on timeout
        ✓ should return a publishable key error if not set
        ✓ should return a server error on invalid JSON
    GET request
      ✓ should inject GET parameters into the url querystring
      ✓ should not append querystring of no params
    custom headers
      ✓ should include headers in request

  Radar
    VERSION
      ✓ should return sdk version
    STATUS
      ✓ should return the list of possible status codes
    initialize
      no publishable key given
        ✓ should print a warning to the console
      called with publishable key
        ✓ should save publishable key to storage
    setHost
      ✓ should save the host to storage
    setUserId
      no userId given
        ✓ should delete userId from storage
      userId given
        ✓ should save userId in storage
    setDeviceId
      no deviceId given
        ✓ should delete deviceId from storage
      deviceId given
        ✓ should save deviceId in storage
        ✓ should save deviceId with installId in storage
    setDescription
      no description given
        ✓ should delete description from storage
      description given
        ✓ should save description in storage
    setMetadata
      no metadata given
        ✓ should delete metadata from storage
      metadata given
        ✓ should save metadata in storage
    setRequestHeaders
      no headers given
        ✓ should delete metadata from storage
      headers given
        ✓ should save metadata in storage
    api errors
      Radar error
        ✓ should return the error enum and empty object
      Http Error
        ✓ should return the error enum and response object
      Unknown
        ✓ should return the unknown error and empty object
    getLocation
      ✓ should propagate the err if not successful
      ✓ should succeed
    trackOnce
      ✓ should call trackOnce if the first arg is a callback
      ✓ should call trackOnce if the first arg is a location object
      ✓ should not throw an error if no callback given
    getContext
      ✓ should call getContext if the first arg is a callback
      ✓ should call getContext if the first arg is a location
    searchPlaces
      ✓ should call searchPlaces
    searchGeofences
      ✓ should call searchGeofences
    autocomplete
      ✓ should call autocomplete
    geocode
      ✓ should call geocode
    reverseGeocode
      ✓ should call reverseGeocode if the first arg is a callback
      ✓ should call reverseGeocodeLocation if the first arg is a location object
    ipGeocode
      ✓ should call ipGeocode if the first arg is a callback
      ✓ should call ipGeocode is the first arg is an object
    getDistance
      ✓ should call getDistanceToDestination

  Navigator
    ✓ should report a location error if geolocation is not available
    ✓ should report a location error if position coordinates are not available
    ✓ should report a permissions error if the user denies location permissions
    ✓ should report a location error if the device errors out fetching location
    ✓ should succeed

  Storage
    getItem
      ✓ should return value of sessionStorage from a given key
      ✓ should return null if key not found
      ✓ should return null if sessionStorage key is undefined
    setItem
      ✓ should write the key and value to the browsers sessionStorage
    clear & removeItem
      ✓ should delete session Storage
      ✓ should clear session storage

  VERSION
    ✓ should match version in package.json
    ✓ should match version in package-lock.json


  96 passing (87ms) 

Merged On 03 Oct 2022 at 07:33:59

Kochis

Awesome! 🙌

Commented On 03 Oct 2022 at 07:33:59

Kochis

Use BASE_API_PATH for all endpoints in JS SDK

Story details: https://app.shortcut.com/radarlabs/story/12086

All tests pass

 Context
    getContext
      location permissions denied
        ✓ should throw a navigation error
      location permissions approved
        ✓ should return a context response

  Geocoding
    geocode
      ✓ should return an address
    reverseGeocode
      location permissions denied
        ✓ should propagate the navigator error
      location permissions approved
        ✓ should return a geocode response
    ipGeocode
      ✓ should return a geocode response

  Routing
    getDistanceToDestination
      location permissions denied
        ✓ should throw a navigation error
      location permissions approved
        no args given
          ✓ should return a routing response
        all args given
          ✓ should return a routing response
    getMatrixDistances
      location permissions denied
        ✓ should throw a navigation error
      location permissions approved
        no args given
          ✓ should return a routing response
        all args given
          ✓ should return a routing response

  Search
    searchPlaces
      location permissions denied
        ✓ should propagate the navigator error
      location permissions approved
        ✓ should return a placeSearch response
      location is given
        ✓ should return a placeSearch response
    searchGeofences
      location permissions denied
        ✓ should propagate the navigator error
      location permissions approved
        ✓ should return a geofenceSearch response
      location is given
        ✓ should return a geofenceSearch response
    autocomplete
      params are not provided
        ✓ should have undefined params and return an autocomplete response
      params are provided
        ✓ should return an autocomplete response

  Track
    trackOnce
      location permissions denied
        ✓ should propagate the navigator error
      location permissions approved
        ✓ should return a track response with metadata
        ✓ should return a track response without metadata

  Trips
    startTrip
      called without tripOptions
        ✓ should include tripOptions each set to unknown
        ✓ should include tripOptions
    updateTrip
      called without status
        ✓ should include status unknown
      called with status
        ✓ should include status

  Device
    getId
      deviceId has not been set
        ✓ should generate a new deviceId in storage, and return the value
      deviceId has already been set
        ✓ should return the deviceId stored saved in the storage

  Http
    http requests
      success
        ✓ should return api response on success
        ✓ should always include Device-Type and SDK-Version headers
        ✓ should filter out undefined values in data
      error
        ✓ should return bad request error
        ✓ should return bad request error
        ✓ should return unauthorized error
        ✓ should return payment required error
        ✓ should return forbidden error
        ✓ should return not found error
        ✓ should return rate limit error
        ✓ should return server error
        ✓ should return unknown error
        ✓ should respond with server error status on request error
        ✓ should respond with network error status on timeout
        ✓ should return a publishable key error if not set
        ✓ should return a server error on invalid JSON
    GET request
      ✓ should inject GET parameters into the url querystring
      ✓ should not append querystring of no params
    custom headers
      ✓ should include headers in request

  Radar
    VERSION
      ✓ should return sdk version
    STATUS
      ✓ should return the list of possible status codes
    initialize
      no publishable key given
        ✓ should print a warning to the console
      called with publishable key
        ✓ should save publishable key to storage
    setHost
      ✓ should save the host to storage
    setUserId
      no userId given
        ✓ should delete userId from storage
      userId given
        ✓ should save userId in storage
    setDeviceId
      no deviceId given
        ✓ should delete deviceId from storage
      deviceId given
        ✓ should save deviceId in storage
        ✓ should save deviceId with installId in storage
    setDescription
      no description given
        ✓ should delete description from storage
      description given
        ✓ should save description in storage
    setMetadata
      no metadata given
        ✓ should delete metadata from storage
      metadata given
        ✓ should save metadata in storage
    setRequestHeaders
      no headers given
        ✓ should delete metadata from storage
      headers given
        ✓ should save metadata in storage
    api errors
      Radar error
        ✓ should return the error enum and empty object
      Http Error
        ✓ should return the error enum and response object
      Unknown
        ✓ should return the unknown error and empty object
    getLocation
      ✓ should propagate the err if not successful
      ✓ should succeed
    trackOnce
      ✓ should call trackOnce if the first arg is a callback
      ✓ should call trackOnce if the first arg is a location object
      ✓ should not throw an error if no callback given
    getContext
      ✓ should call getContext if the first arg is a callback
      ✓ should call getContext if the first arg is a location
    searchPlaces
      ✓ should call searchPlaces
    searchGeofences
      ✓ should call searchGeofences
    autocomplete
      ✓ should call autocomplete
    geocode
      ✓ should call geocode
    reverseGeocode
      ✓ should call reverseGeocode if the first arg is a callback
      ✓ should call reverseGeocodeLocation if the first arg is a location object
    ipGeocode
      ✓ should call ipGeocode if the first arg is a callback
      ✓ should call ipGeocode is the first arg is an object
    getDistance
      ✓ should call getDistanceToDestination

  Navigator
    ✓ should report a location error if geolocation is not available
    ✓ should report a location error if position coordinates are not available
    ✓ should report a permissions error if the user denies location permissions
    ✓ should report a location error if the device errors out fetching location
    ✓ should succeed

  Storage
    getItem
      ✓ should return value of sessionStorage from a given key
      ✓ should return null if key not found
      ✓ should return null if sessionStorage key is undefined
    setItem
      ✓ should write the key and value to the browsers sessionStorage
    clear & removeItem
      ✓ should delete session Storage
      ✓ should clear session storage

  VERSION
    ✓ should match version in package.json
    ✓ should match version in package-lock.json


  96 passing (87ms) 

Merged On 03 Oct 2022 at 06:04:10

Kochis

Awesome! 🙌

Commented On 03 Oct 2022 at 06:04:10
Issue Comment

Kochis

Typescript?

Hello, I have been tasked with finding a solution to get address autocomplete for my company and came across Radar and would love to use it, however we use pretty strict typescript and thus makes using this package pretty difficult.

Are there any plans to convert to typescript? Or at least publish a types package?

Forked On 15 Sep 2022 at 08:50:19

Kochis

Hi @jackLIT,

That's great to hear you're considering Radar! Typescript bindings and converting the project to typescript is on our long-list of improvements to project, but probably not something we'll get to in the near term.

That being said, we're always open to contributions.

Commented On 15 Sep 2022 at 08:50:19
Issue Comment

Kochis

v3.3.0-beta.3
Forked On 29 Aug 2022 at 02:16:05

Kochis

This is just for a beta release? Should there be lockfile changes?

Commented On 29 Aug 2022 at 02:16:05
Issue Comment

Kochis

Rendering lines and text

Will there be a part 2 & 3 where you talk about adding line work and text?

Forked On 22 Aug 2022 at 02:45:11

Kochis

Perhaps one day, but no plans at the moment.

Commented On 22 Aug 2022 at 02:45:11

Kochis

started

Started On 19 Aug 2022 at 02:37:53

Kochis

move createBuffer out of render loop (fix FF crashes)

Pushed On 19 Aug 2022 at 02:37:29

Kochis

add placeholder code

Pushed On 18 Aug 2022 at 02:10:56

Kochis

use pre-loaded tiles as backups

Pushed On 17 Aug 2022 at 01:25:30

Kochis

update link

Pushed On 15 Aug 2022 at 02:53:57

Kochis

fix link

Pushed On 12 Aug 2022 at 09:14:07

Kochis

fix link

Pushed On 12 Aug 2022 at 09:12:43

Kochis

move to src directory

Pushed On 11 Aug 2022 at 06:46:32

Kochis

Create README.md

Pushed On 11 Aug 2022 at 06:38:32
Create Branch
Kochis In kochis/webgl-map Create Branchmain

Kochis

Experiment to build a vector map from scratch

On 11 Aug 2022 at 06:19:04
Create Branch

Kochis

Experiment to build a vector map from scratch

On 11 Aug 2022 at 05:39:37