Disconnect throws an indexedDB error
Describe the bug (current behavior)
The latest demo DApp (link) throws the following error when the Disconnect button is clicked:
IndexedDBStorage.js:73 Uncaught DOMException: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
To Reproduce Steps to reproduce the behavior:
- Go to the latest example DApp deployment
- Click
Request Permission, accept the modal (all wallet-connect and p2p wallet options would do) - Click
Disconnect
An indexedDB error is thrown in the console, but the pairing is successfully deleted. We came across this issue while testing other DApps on v4.2.1
Hi @AlexandrosGounis, I’m having a hard time trying to reproduce this issue. Here are the steps I followed:
- Request permission, sync with the wallet, and then approve the request on the wallet side.
- Click "Disconnect."
Is this correct?
@IsaccoSordo,
The issue is because the beacon client assumes an IndexedDB exists and is operable.
I noticed that my web client did not have a beacon IndexedDB instance, probably because I used the Clear Site Data in the past.
To Reproduce
- Using Chrome on desktop, go to the latest example DApp deployment
- Open the dev console → Application tab → Storage → Clear Site Data
- Request permissions, approve
- Click disconnect
The issue is that indexedDB may fail to be instantiated for a number of reasons (origin policies, unsupported browser, or errors during instantiation). It might be worth catching errors on instantiation, or checking if an indexedDB exists before applying transactions on it
Hi @AlexandrosGounis,
as you correctly pointed out, there are situations in which indexDB fails to operate.
With #762, we added error checking around our "IndexedDB implementation".
Here's the lines of code which addresses your issue: L491-#L498
The fix has been included in v4.2.2