Too many transactions queued with IndexedDB adapter
ajl236 opened this issue · 2 comments
Chrome Canary 50 throws event.target.transaction.error “Too many transactions queued”" with Lawnchair's .get[array] method with the Indexed DB adapter. Chrome Canary now throttles after 255 queued transactions as described here.
My offline geo web app has 30,000+ JSON objects managed by Lawnchair and often calls.get(array_of_keys,...) to request 500 objects with the required keys depending on map location. This has been working for many years with excellent performance on many different platforms and mobile devices.
It seems that the current .get implementation for IndexedDB creates a transaction for each key required. This triggers Chrome Canary to stop the show.
After searching the web for IndexedDB IN query functionality I found this article which seems to use cursors and fewer transactions for its algorithm. I hacked together this function using that algorithm which works on Chrome Canary 50 where the .get method now fails.
Good job, @ajl236. I took your solution, added the "query queuing" that @brianleroux uses, and made it work for (non-array) objects. I have several local changes that I would like to make into v0.7.0, but I think I'll get this one out there sooner rather than later so I created pull request #226.
Resolution has been merged and committed.