-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errored transactions seem to still commit #41
Comments
The following test fails: index.test.ts > path index > doesn't allow duplicate values on a unique idnex The issue actually seems to be due to a bug in fake-indexeddb; see dumbmatter/fakeIndexedDB#41.
Playing around with it a little more, here are some observations:
|
Thanks for the minimal reproduction! You're awesome for that. Turns out this was a simple problem, as you can see in the commit referenced above. I was not tracking the newly-created object in the rollback log until after the indexes were successfully created, so a ConstraintError during index creation would not remove the object from the store. What you noticed about more It's fixed in v3.0.1. |
Brilliant! Glad to see it wasn't too hairy of an issue. Thanks for the fix :-) |
First of all, fantastic work on this! It's been a great help to me recently, letting me develop in the node environment without having to use something overpowered like puppeteer.
That being said, I think I've found a bug.
We first crease a simple database; it has one object store with an indexed attribute
indexed_attr
. We then, in two separate transactions, place an object{ indexed_attr: 'xxx' }
into the database. As we'd expect, sinceindexed_attr
is unique, the first transaction succeeds and the second fails. However, they both seem to commit: we find that the resultant database contains two copies of the object, not just one.I do not know if this is spec-compliant behaviour or not, but it differs from Chrome, which you note has a 99% pass rate on the W3C IndexedDB test suite. In Chrome, the resultant db has only one copy of the object.
The text was updated successfully, but these errors were encountered: