Closed
Bug 755514
Opened 12 years ago
Closed 12 years ago
Cursor.update support for keypath arrays
Categories
(Core :: Storage: IndexedDB, defect)
Tracking
()
RESOLVED
FIXED
mozilla16
People
(Reporter: khuey, Assigned: sicking)
References
Details
Attachments
(1 file, 2 obsolete files)
3.66 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Reporter | ||
Comment 1•12 years ago
|
||
We added the support already, just needs some tests.
Attachment #637190 -
Flags: review?(bent.mozilla)
Assignee | ||
Comment 2•12 years ago
|
||
Comment on attachment 637190 [details] [diff] [review]
Patch
Review of attachment 637190 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/indexedDB/test/unit/test_complex_keyPaths.js
@@ +175,5 @@
> + let cursor = e.target.result;
> + if (cursor) {
> + request = cursor.update(info.value);
> + request.onerror = errorHandler;
> + request.onsuccess = grabEventAndContinueHandler;
This won't actually test what we want to test. In the object store used here we don't use inline keys at all. So you'll want to move this code up to the "Test creating object stores and inserting data" part of the test.
Also, you only need to put the test in the part of the code run when we have a "key" property. That way you won't need the if(cursor) tests.
Attachment #637190 -
Flags: review?(bent.mozilla) → review-
Reporter | ||
Comment 3•12 years ago
|
||
Assignee: nobody → khuey
Attachment #637190 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #637720 -
Flags: review?(jonas)
Assignee | ||
Comment 4•12 years ago
|
||
Comment on attachment 637720 [details] [diff] [review]
Patch
Review of attachment 637720 [details] [diff] [review]:
-----------------------------------------------------------------
Err.. info.key is always true there, otherwise we would have called 'continue' earlier. I'll write something up.
Attachment #637720 -
Flags: review?(jonas) → review-
Reporter | ||
Comment 5•12 years ago
|
||
Ok, I'm convinced that I don't actually understand how this is supposed to work.
Assignee: khuey → jonas
Assignee | ||
Comment 6•12 years ago
|
||
Basically you were doing the right thing, except that you had inverted the initial if-branch-check, causing none of your code to actually run. You were also using an index cursor for some reason even though that wasn't needed.
This patch both adds tests which makes sure that calling
cursor.update(<existing value>)
always works (which is what the previous versions of the patch was trying to do I believe).
It also tests that
cursor.update(<value with key changed>)
always throws.
This actually surfaced a case where we were doing the wrong thing. Calling cursor.update(<existing value>) on an object store with an empty keyPath throws. The fix is to remove a bogus check.
Attachment #637720 -
Attachment is obsolete: true
Attachment #637766 -
Flags: review?(khuey)
Reporter | ||
Updated•12 years ago
|
Attachment #637766 -
Flags: review?(khuey) → review+
Reporter | ||
Comment 7•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in
before you can comment on or make changes to this bug.
Description
•