jakearchibald / idb

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

TimeoutError: Transaction timed out due to inactivity #258

Closed dowmeister closed 2 years ago

dowmeister commented 2 years ago

Hi, got this error TimeoutError: Transaction timed out due to inactivity. during an update operation.

Honestly, i dont know how to reproduce. This update operation is fired every second and occasionally it fails with this error.

The code is quite simple:

startPersistJobInterval() {
        truckyService.writeLog('Starting interval to persist local job');
        this.persistJobInterval = setInterval(this.persistJob.bind(this), 1000);
    }

persistJob() {
        if (this.currentJob != null) {
            this.db.put('jobs', this.currentJob)
                .catch((reason) => {
                    console.log(`Error updating the current job in the local db: ${reason}`);
                });
        }
    }

There is a possible reason? There is something i can do to avoid it?

I store the db reference in local property so it's a long time instance, is correct? Maybe i have to open\close the database connection each time i use it?

Thanks

jakearchibald commented 2 years ago

I don't think I have a hope of debugging this without knowing more details, eg which browsers are firing this error. It's almost certainly an issue with IndexedDB rather than this library. I can take a further look and maybe reopen if more details are given.

piotr-cz commented 2 years ago

More info in Chromium bugs Issue tracker: 855624