Summary: | [IndexedDB] array index keys are concatenated across cursor lifetime | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Anderson <jchris> | ||||||
Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | alecflett, beidson, commit-queue, jchris, jsbell, nolan, simon.fraser, timothy, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | iOS 8.1 | ||||||||
Attachments: |
|
Description
Chris Anderson
2014-11-07 07:47:15 PST
Oh dear, it's much worse than I thought. Here is the same bug triggered without multiEntry: http://requirebin.com/?gist=4395a44d50f3c6dddcb8 Good news is this might be a presentation concern, as the results come back in the correct order at least. Maybe this helps diagnose or helps others with workarounds: In my case I know all my keys are 2 element arrays. And the cursor starts with a new correct key on the first row of every transaction. So if your keys are big, paginate. And know how many elements are in your array keys, and then you can run key.splice(-n) where n is your array key length. It doesn't flatten it just concats. Created attachment 243214 [details]
Patch
Created attachment 243238 [details]
Patch
Those RequireBin tests weren't working for me, so I browserified them. You can open these two links, and if it's green, then they pass, and if it's red, they fail: * http://bl.ocks.org/nolanlawson/b23876ee55085ebb4696 * http://bl.ocks.org/nolanlawson/fa4f74be1810d726db8a I'm seeing successes in Chrome 43 and Firefox 38, but failures in Safari 8.0.7 and Webkit nightly r185316 (all on desktop Yosemite). Comment on attachment 243238 [details]
Patch
It would be useful to check through any of the currently disabled IDB tests to see if this fixes them - Reenabling them would be preferable to changing this test.
Since Mark isn't around to respond, I just tried the entire suite of IDB tests and this did not change behavior on any of the skipped tests. Therefore the included change seems appropriate to me. r+, will prep for landing. |