w3c / IndexedDB

Indexed Database API

Home Page:https://w3c.github.io/IndexedDB/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cursor.request

jakearchibald opened this issue · comments

Requests for cursors are different as they can succeed many times. When you call cursor.continue() the success of that operation is provided in the request returned by source.openCursor().

If I want to give an object store to another piece of code, I can just pass the object store. However, if I want to pass the cursor elsewhere, I also have to pass the related request.

Should cursor.request return https://w3c.github.io/IndexedDB/#cursor-request?

I've run into wanting this for prollyfills. SGTM.

Should be easy to spec/test/ship.

Yeah, I ran into this trying to make wrap() and unwrap() functions that 'upgrade' IDB objects. Works for everything except cursors.

I'll take this on.

I've been wanting to document how standards are developed for a while, so @surma and I will film ourselves updating the spec and writing tests.

@asutherland @aliams @beidson - any feedback on this?

No objections here. It sounds like we're just exposing a property that is already initialized as part of the cursor and should live as long as the cursor.

Did my thumbs-up not say it all? ;) This sounds good from a Gecko/Firefox perspective. We have the request available and Jake's magical upgrade use-case sounds both reasonable and essential to help move IDB forward from an API that only an implementer could love to the favorite API of developers everywhere!

yah this is fine.

Thumbs everywhere! Thanks all!

Thanks @jakearchibald and @surma - looking forward to the PRs. Blink change should be trivial once WPTs are in.

For posterity, here's the episode @jakearchibald and @surma did about this very issue https://www.youtube.com/watch?v=y1TEPQz02iU

FYI, @Yannic's change just landed in the Chromium repo so this should be available for testing in the next Chrome Canary build.

Just landed in Firefox!

Hey @julienw - if you know the prospective Firefox release number I can add it to the "under construction" box https://w3c.github.io/IndexedDB/#dom-idbcursor-request

https://bugzilla.mozilla.org/show_bug.cgi?id=1536540 is fixed in Firefox 77, targeted to reach release ~ June 2nd