Bug 178380 - IndexedDB index cursor stops when updating an object
Summary: IndexedDB index cursor stops when updating an object
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Safari 11
Hardware: Unspecified All
: P2 Normal
Assignee: Nobody
URL: http://dexie.org/test/dexie-issue-594...
Depends on:
Reported: 2017-10-17 00:41 PDT by David Fahlander
Modified: 2017-10-17 08:12 PDT (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description David Fahlander 2017-10-17 00:41:53 PDT
Steps to reproduce:

1. Opening a cursor on an index (IDBIndex.prototype.openCursor())
2. req.onsuccess: call cursor.update() or store.put() 
3. Next req.onsuccess indicates end of iteration (req.result is falsy)

Expected behavior:

3. Next req.onsuccess lands on the next object matched in the index.

Note: There seems not to be an issue for IDBObjectStore.prototype.openCursor(), it's just IDBIndex that fails.

Repro: http://dexie.org/test/dexie-issue-594/index.html

The repro should show:

But with Safari 10 or 11, it shows

The reason the last digit is 1, is because a call to Dexie.Collection.modify() will stop after first match, as it calls cursor.update() on it.
Comment 1 David Fahlander 2017-10-17 00:43:22 PDT
Original issue: https://github.com/dfahlander/Dexie.js/issues/594