RESOLVED FIXED 92562
IndexedDB: IDBCursor.continue(key) does not throw for key "behind" cursor
https://bugs.webkit.org/show_bug.cgi?id=92562
Summary IndexedDB: IDBCursor.continue(key) does not throw for key "behind" cursor
Joshua Bell
Reported 2012-07-27 17:02:15 PDT
IndexedDB: IDBCursor.continue(key) does not throw for out of range key
Attachments
Patch (10.43 KB, patch)
2012-07-27 17:08 PDT, Joshua Bell
no flags
Patch (12.27 KB, patch)
2012-07-27 17:16 PDT, Joshua Bell
no flags
Patch (15.91 KB, patch)
2012-08-01 10:26 PDT, Joshua Bell
no flags
Joshua Bell
Comment 1 2012-07-27 17:08:54 PDT
Joshua Bell
Comment 2 2012-07-27 17:11:32 PDT
I found this while looking at our exception coverage for http://webkit.org/b/85513 dgrogan@, alecflett@ - please take a look.
Joshua Bell
Comment 3 2012-07-27 17:12:24 PDT
Comment on attachment 155090 [details] Patch Whoops, forgot expectations.
Joshua Bell
Comment 4 2012-07-27 17:16:28 PDT
Joshua Bell
Comment 5 2012-07-27 17:16:57 PDT
Updated patch has expectations and removes some LOG_ERROR lines I left in.
Joshua Bell
Comment 6 2012-07-30 16:05:44 PDT
(In reply to comment #2) > I found this while looking at our exception coverage for http://webkit.org/b/85513 > > dgrogan@, alecflett@ - please take a look. Ping?
David Grogan
Comment 7 2012-07-30 16:16:24 PDT
Comment on attachment 155092 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=155092&action=review LGTM > Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp:45 > +IDBCursorBackendImpl::IDBCursorBackendImpl(PassRefPtr<IDBBackingStore::Cursor> cursor, IDBCursor::Direction, CursorType cursorType, IDBTransactionBackendImpl* transaction, IDBObjectStoreBackendImpl* objectStore) I'm guessing IDBCursor::Direction is still used by IDBCursorBackendProxy? > LayoutTests/storage/indexeddb/resources/cursor-continue-dir.js:55 > + request.onsuccess = null; What's going on with the request.onsuccess = null lines?
Joshua Bell
Comment 8 2012-07-30 16:24:34 PDT
Comment on attachment 155092 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=155092&action=review >> Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp:45 >> +IDBCursorBackendImpl::IDBCursorBackendImpl(PassRefPtr<IDBBackingStore::Cursor> cursor, IDBCursor::Direction, CursorType cursorType, IDBTransactionBackendImpl* transaction, IDBObjectStoreBackendImpl* objectStore) > > I'm guessing IDBCursor::Direction is still used by IDBCursorBackendProxy? No, it could be removed. (I rushed this patch a bit since it was a regression and I was headed out.) The direction is passed through to the IDBBackingStore::Cursor creation during the openCursor call, and the backend cursor is passed in here. Turns out the IDBCursorBackend* no longer needs to know about the direction at all. I can remove it. (I'll post an updated patch on Wednesday.) >> LayoutTests/storage/indexeddb/resources/cursor-continue-dir.js:55 >> + request.onsuccess = null; > > What's going on with the request.onsuccess = null lines? Debugging residue, I'll remove them. (Before fixing the bug the cursor.continue() call was not throwing, so the test would infinite-loop if the success handler was still around.)
Alec Flett
Comment 9 2012-07-31 09:21:43 PDT
in another patch, I'm making progress towards replacing the 'unsigned short' directions with IDBCursor::Direction, so definitely don't remove it! My intention is that for direction, either you're using the string ("next") or the enum, (and the string quickly gets transformed into the enum) but not the unsigned short. But this LGTM to me as well - makes me wonder what else we can rip out of the cursor backend, since it sounds like the backing store is doing most of the work.
Joshua Bell
Comment 10 2012-08-01 09:32:57 PDT
(In reply to comment #9) > in another patch, I'm making progress towards replacing the 'unsigned short' directions with IDBCursor::Direction, so definitely don't remove it! We're just talking about removing it from the IDBCursorBackendImpl constructor - that's not a problem, is it? > But this LGTM to me as well - makes me wonder what else we can rip out of the cursor backend, since it sounds like the backing store is doing most of the work. It's pretty slim at this point. Most of the code is boilerplate or prefetching. I think some of the deleteFunction() checks can turn into ASSERTs but I'll leave that for later.
Alec Flett
Comment 11 2012-08-01 10:05:57 PDT
(In reply to comment #10) > (In reply to comment #9) > > in another patch, I'm making progress towards replacing the 'unsigned short' directions with IDBCursor::Direction, so definitely don't remove it! > > We're just talking about removing it from the IDBCursorBackendImpl constructor - that's not a problem, is it? Nope...I just mean don't remove the enum itself in the process of cleaning this up..
Joshua Bell
Comment 12 2012-08-01 10:26:08 PDT
Joshua Bell
Comment 13 2012-08-01 10:27:28 PDT
Latest patch addresses dgrogan@'s comments - the unused direction argument to the IDBCursorBackendImpl is removed, and the unnecessary event handler clearing is removed. tony@ (or others) - r? cq?
Joshua Bell
Comment 14 2012-08-01 11:40:59 PDT
Oops, tony@ is unavailable. ojan@, abarth@, eric@ - r? cq?
Ojan Vafai
Comment 15 2012-08-01 12:28:08 PDT
Comment on attachment 155832 [details] Patch rs=me
WebKit Review Bot
Comment 16 2012-08-01 13:21:09 PDT
Comment on attachment 155832 [details] Patch Clearing flags on attachment: 155832 Committed r124361: <http://trac.webkit.org/changeset/124361>
WebKit Review Bot
Comment 17 2012-08-01 13:21:14 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.