IDBObjectStoreBackendImpl.cpp: During the async task execution, this is run: if (putMode == CursorUpdate && !keyPathKey->isEqual(key)) { callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::DATA_ERR, "The key fetched from the keyPath does not match the key of the cursor.")); return 0; } Per spec, this should synchronously raise an exception during the put() call instead.
... and while there, move all of the key selection (and value updating) logic into put(), rather than the putInternal async task, to match recent discussion on public-webapps. The async task should be handed the final value and final key to insert with.
(In reply to comment #1) > ... and while there, move all of the key selection (and value updating) logic into put(), rather than the putInternal async task, to match recent discussion on public-webapps. > > The async task should be handed the final value and final key to insert with. Slight wrinkle - for generated keys (i.e. autoIncrement) the generation step should occur within the async task within the transaction. This may require that in put() we check to see if a value can be inserted (by inserting a dummy value?) and then in putInternal() we run the key generation step and actually insert the key.
Created attachment 124610 [details] Patch
Filed https://bugs.webkit.org/show_bug.cgi?id=77374 for the "the generation step should occur within the async task within the transaction" note.
The change looks sane. If dgrogan or someone else can do an unofficial review, I can r+.
Comment on attachment 124610 [details] Patch LGTM
Comment on attachment 124610 [details] Patch Clearing flags on attachment: 124610 Committed r106387: <http://trac.webkit.org/changeset/106387>
All reviewed patches have been landed. Closing bug.