jakearchibald / idb

IndexedDB, but with promises
https://www.npmjs.com/package/idb
ISC License
6.31k stars 356 forks source link

fix: null error #131

Closed mkg20001 closed 3 years ago

mkg20001 commented 4 years ago

When adding a duplicate key the tx.error was null but tx.srcElement.error wasn't

This PR reads it from there if it fails there instead

A long-term solution would be to check for srcElement/target .onerror as well as tx.onerror

jakearchibald commented 3 years ago

Can you give me an example that shows the issue with the current version of the library?

fgirardey commented 3 years ago

Oh that might explain why i have so much null errors that are reported on Sentry, but i have never been able to reproduce the scenario that throws a null error because of course i don't have stacktraces

jakearchibald commented 3 years ago

Can you give me an example that shows the issue with the current version of the library?

fgirardey commented 3 years ago

Unfortunately there is not much informations : https://sentry.io/share/issue/9575ef1ba0a2479b8f11c5604e6f6d47

It could be totally not related to IDB but i use IDB 5.0.4 and it seems to happen a lot on Chrome Mobile iOS, Safari and Firefox, never on Chrome.

null-errors.csv.zip

fgirardey commented 3 years ago

I have finally found the source of the null error and this is absolutely not related with idb, it was just an error thrown by a third party script badly handled because the error is not fully reported to avoid leaks : https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror#notes

Sincerely sorry for the mislead.

jakearchibald commented 3 years ago

Hah no worries!