Releases: deiu/secure-webstore
Releases · deiu/secure-webstore
Release list
2.0.0
Fixed
destroy()never resolved. Three defects together, all long standing
(#2):- The
Storeconstructor started_init()without awaiting it, and the
first operation called_init()again before that open had resolved. The
if (this._dbp)guard did not hold, so two connections opened and only the
second was tracked. The first leaked and held the database open, so
deleteDatabasestayed blocked, and with noonblockedhandler neither
onsuccessnoronerrorever fired. destroy()did not wait for the close before asking for the delete._close()did not forget the connection.IDBDatabase.close()fires no
oncloseevent, so_dbpkept pointing at a closed connection and every
later call threwInvalidStateError. This is what made thefreeze
listener a one way door: freeze the page and the store was dead.
- The
- A stray
console.login the version change handler (#2).
Added
- Lifecycle tests:
destroy(), the second connection case, a missing
IndexedDB implementation, thefreezelistener, and encrypting before
init(). Line coverage ofsrcgoes from 79.8% to 93.4% (#2). - A GitHub Actions workflow that typechecks, builds and tests on every push to
masterand every pull request. It replaces the Travis config that
(#1) deleted (#2, #3). - A
preparescript.dist/is no longer committed, so without it
npm publishand an install from the git url both shipped a package with no
build in it (#2). typecheckandtest:coveragescripts.typecheckcovers the tests as
well as the sources (#3).
Changed
- The build moves from webpack to tsup and emits ESM, CJS and a browser
bundle, each with its own declarations (#1). - The tests move from mocha-headless-chrome to vitest with
fake-indexeddb,
so they need no browser (#1). close()now returns a promise. It used to close the connection
synchronously and return nothing. Await it if the next thing you do depends
on the connection being closed (#2).destroy()now rejects withCannot delete the database while another connection is openinstead of hanging when the delete is blocked (#2).- The
easy-web-cryptodependency moves to ^2.0.0. Its runtime is unchanged; its types are more precise (easy-web-crypto 2.0.0). - The store reopens on demand after a
close(), because the connection is
forgotten rather than kept in a closed state (#2). - The
<script>tag bundle moved todist/secure-webstore.global.js.
dist/cjs/secure-webstore.jswas a UMD bundle that set aSecureStore
global; since the tsup move it is plain CommonJS and fails in a browser. A
page that loads that path from a CDN without pinning a version must update
the URL (#1, #2).
Removed
dist/is no longer committed to the repository (#1).