Skip to content

Commit

Permalink
- Breaking change to __forceClose: Prepend an optional argument to the
Browse files Browse the repository at this point in the history
    signature, `dbName` for force-closing databases of a particular name
- Add missing API: `versionchange` and `blocked` events (currently assumes
    single process); addresses indexeddbshim#2
- Fix: Close connection on abort (setting closed flag)
- Fix: Have `deleteDatabase` empty relevant `connections` (relevant
    for `__forceClose` as well as `open`)
- Refactoring: Rename `transformW3CStack.js` to `transformV8Stack.js`
- Refactoring: Move excluded files into good-bad files file
- Testing (W3C Old): Partly update `TransactionBehavior.js` tests to
    ensure `objectStoreNames` are compared as arrays
- Testing (Mocha): For now, make exception for Chrome as with other
    browsers to `window.onerror` tests in `IDBTransaction/events-spec.js`
    but keep note in testing list
- Testing (mock): Fix for `blocked` event's expected `newVersion` (submitted
    fix as <kristofdegrave/indexedDBmock#2>)

IndexedDB Test counts:
    323 normal files (including 1 domstringlist file):
        315 are all good, 3 have some that are bad,
        5 have some that time out and 3 have some that do not run
    7 excluded files (uncaught exceptions during testing):
        `bindings-inject-key.js`,
        `keypath-exceptions.js`,
        'event-dispatch-active-flag.js',
        'fire-error-event-exception.js',
        'fire-success-event-exception.js',
        'fire-upgradeneeded-event-exception.js'
        'upgrade-transaction-deactivation-timing.js'

Current IndexedDB (and domstringlist) test statuses (vmTimeout = 40000):
  'Pass': 1168, (including 4 domstringlist tests but avoiding exclusions)
  'Fail': 6,
  'Timeout': 5,
  'Not Run': 3,
  'Total tests': 1182 (including 4 domstringlist tests but avoiding exclusions)
  • Loading branch information
brettz9 committed Apr 14, 2017
1 parent 749ff4f commit c87d4c7
Show file tree
Hide file tree
Showing 32 changed files with 2,329 additions and 1,499 deletions.
18 changes: 14 additions & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ they were actually changes since a more recent version on `master`.
- Add missing APIs: Implement `IDBObjectStore.getAll`,
`IDBObjectStore.getAllKeys`
- Add missing API: Binary keys
- Add missing API: `versionchange` and `blocked` events (currently assumes
single process)
- Fix: Ensure `IDBKeyRange`'s `lower` and `upper` get round-tripped
key-encoded (e.g., to ensure a `DataView` gets converted into
an `ArrayBuffer`)
Expand Down Expand Up @@ -502,6 +504,9 @@ they were actually changes since a more recent version on `master`.
closed check, and `NotFoundError` object store check); `TypeError` mode
check per newly corrected spec behavior, to follow all other exception
checks
- Fix: Close connection on abort (setting closed flag)
- Fix: Have `deleteDatabase` empty relevant `connections` (relevant
for `__forceClose` as well as `open`)
- Repo files: Rename test folders for ease in distinguishing
- Optimize: Only retrieve required SQLite columns
- Optimize: Have `IDBObjectStore` and `IDBIndex`'s `get` and
Expand Down Expand Up @@ -582,6 +587,8 @@ they were actually changes since a more recent version on `master`.
- Testing (mock): Update IndexedDBMock tests
- Testing (mock): Expect `InvalidStateError` instead of `ConstraintError`
when not in an upgrade transaction calling `createObjectStore`
- Testing (mock): Fix for `blocked` event's expected `newVersion` (submitted
fix as <https://github.com/kristofdegrave/indexedDBmock/pull/2>)
- Testing (W3C Old): Fix global
- Testing (W3C Old): Bump timeout for browser key validity tests
- Testing (W3C Old): `IDBFactory.open` tests to do more flexible
Expand All @@ -608,6 +615,8 @@ they were actually changes since a more recent version on `master`.
- Testing (W3C): Add separate tests for events and workers; also
incorporate tests for `DOMStringList` and `DOMException`
- Testing (W3C Old): Fix `DOMStringList` API usage (failing on Safari)
- Testing (W3C Old): Partly update `TransactionBehavior.js` tests to
ensure `objectStoreNames` are compared as arrays
- (Testing)
(Unless stated otherwise, "Browser" below refers to Safari 10.1 and
Chrome 57.0.2987.133 (64-bit); note that both browsers (especially
Expand All @@ -625,13 +634,11 @@ they were actually changes since a more recent version on `master`.
From fakeIndexedDB (Browser), only the first test is
passing (as expected due to rollback limitations);

From indexedDBmock (Node and browser), only `database.js` is not passing
From indexedDBmock (Node and browser), all tests are now passing.
(see <https://github.com/kristofdegrave/indexedDBmock/compare/f6cdf451769827e13c746984b820096b0de3ac6d...master>
for any new changes to add to tests).

From old W3C (Node and browser), only the following are not passing:
IDBDatabase.close.js,
TransactionBehavior.js
From old W3C (Node and browser), all tests are now passing.

From new W3C (Node):
See [`/test-support/node-good-bad-files.js`](test-support/node-good-bad-files.js)
Expand Down Expand Up @@ -690,4 +697,7 @@ they were actually changes since a more recent version on `master`.
error checks for Safari too
- Testing (Mocha): Fall back to genuine `Event`/`DOMException` when shims not
present (if testing native)
- Testing (Mocha): For now, make exception for Chrome as with other
browsers to `window.onerror` tests in `IDBTransaction/events-spec.js`
but keep note in testing list
- Testing (Cordova): Update Cordova testing (untested)
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ be used. Probably only needed for testing or environments where full
introspection on class relationships is required.
See this [SO topic](http://stackoverflow.com/questions/41927589/rationales-consequences-of-webidl-class-inheritance-requirements)

### shimIndexedDB.\__forceClose(connIdx, msg)
### shimIndexedDB.\__forceClose([dbName], [connIdx], [msg])

The spec anticipates the [closing of a database connection with a forced flag](http://w3c.github.io/IndexedDB/#steps-for-closing-a-database-connection).

Expand All @@ -166,14 +166,18 @@ where this may occur:
Since the latter examples are under the browser's control, this method may
be more useful on the server or for unit-testing.

If the first argument, `connIdx` is missing (or `null` or `undefined`),
all connections will be force-closed. It can alternatively be an integer
representing a 0-based index to indicate a specific connection to close.
If the first argument, `dbName` is missing (or `null` or `undefined`),
all connections to all databases will be force-closed.

The second argument `msg` will be appended to the `AbortError` that will be
If the second argument, `connIdx` is missing (or `null` or `undefined`),
all connections with the given name will be force-closed. It can
alternatively be an integer representing a 0-based index to indicate a
specific connection to close.

The third argument `msg` will be appended to the `AbortError` that will be
triggered on the transactions of the connection.

Individual `IDBDatabase` database connections can also be force-closed
Individual `IDBDatabase` database instances can also be force-closed
with a particular message:

```js
Expand Down Expand Up @@ -374,7 +378,8 @@ Please make sure someone else hasn't already reported the same bug though.
Here is a summary of main [known issues](https://github.com/axemclion/IndexedDBShim/issues/262#issuecomment-254413002)
to resolve:

1. `blocked` and `versionchange` `IDBVersionChangeEvent` event support ([#2](https://github.com/axemclion/IndexedDBShim/issues/2) and [#273](https://github.com/axemclion/IndexedDBShim/issues/273))
1. `blocked` and `versionchange` `IDBVersionChangeEvent` event support ([#2](https://github.com/axemclion/IndexedDBShim/issues/2) and [#273](https://github.com/axemclion/IndexedDBShim/issues/273)) across
processes/browser windows
2. Some issues related to [task/micro-task timing](https://github.com/axemclion/IndexedDBShim/issues/296)
in Node (for inherent limitations in the browser, see below).

Expand Down
Loading

0 comments on commit c87d4c7

Please sign in to comment.