angular2-indexeddb icon indicating copy to clipboard operation
angular2-indexeddb copied to clipboard

Some functions resolve before they are complete

Open IS-KPL opened this issue 6 years ago • 0 comments

Hey When using the library I noticed that "clear()" in the angular2-indexeddb.ts has multiple resolve() as seen in the picture. From what I have read and experienced, the lower one results in the promise resolving before the clear() is actually complete. I assume this was not intentional as I can see only some functions in the file have this setup, so I thought I would bring it to your attention. multipleresolves

Furthermore onsuccess is not the same as complete, depending on the data being handled, onsuccess can finish way before complete(relatively speaking as it is still in microseconds). This means anything that should resolve the promise, should resolve in the "complete" callback of the transaction instead

IS-KPL avatar Feb 20 '19 14:02 IS-KPL