Open glsignal opened 9 years ago
Yes, it's a well known issue. And one of the reasons, why default treo API uses one transaction per operation.
From my experience it should work only in Chrome. Because it handles Promises and IDB transactions right. But in all other browsers you have to rely on onsuccess
callback and schedule next operation synchronously.
Jake Archibald recently wrote great post explaining microtasks and how much there're inconsistency between browser implementations.
Try to use es6-promise
, because it forces some browsers to use MutationObserver and it might help, but it most likely won't work with IndexedDBShim.
Another idea is to generate localId
manually and use Promise.all
.
Ah this old chestnut. I'd come across the microtask issue a while back (though not Jake's extremely well explained post), but had dismissed it as I'm working on Chrome exclusively.
I'll try out the polyfill and see how it goes, thanks for your comment :)
I've run into an odd issue using
0.6.0-rc2
where the transaction becomes inactive beforenodeStore.add
, do you have any ideas on why this might happen or how to avoid it? This implementation seems like a valid approach, but I might be missing something fundamental here.