atom / telemetry

sends usage metrics to GitHub's internal analytics pipeline
MIT License
11 stars 12 forks source link

Add IndexedDB database implementation #28

Closed rafeca closed 5 years ago

rafeca commented 5 years ago

This PR adds an IndexedDB database implementation by building on top of https://github.com/atom/telemetry/pull/27.

This allows the telemetry package to keep events between sessions (so it fixes https://github.com/atom/telemetry/issues/26).

To interact with the IndexedDB API I've used the idb package, which is mostly a thin wrapper to expose the API using Promises.

Benefits of this library:

Next steps:

rafeca commented 5 years ago

As suggested by @as-cii , I've started using electron-mocha to not have to mock indexedDB or localStorage. The change is in https://github.com/atom/telemetry/pull/28/commits/eadea5f94822b8b8d484e8c9ea79760c81929777