Closed aphelionz closed 4 years ago
Update: I added a delay of 500ms between opening tabs in the puppeteer script and that seems to have helped.
If each tab is on the same origin, each tab will try initialise the repo simultaneously which will lead to race conditions.
I'd either:
a. wait for the first tab to finish the initialisation before opening other tabs, though this may cause other subtle bugs as each tab will maintain it's own network connections but share a peer ID
b. switch to the shared-worker IPFS node (though be aware it's got a very limited API at present) - see the sharing a node across tabs example
Makes sense! I think we're good then since I introduced the delay. I am hacking on the shared-worker now and will report back soon :+1: but since pubsub isnt yet an option there we can't rely on that for OrbitDB
Version: 0.49.0
Platform: Browser (headless chrome, puppeteer)
Subsystem: Node instantiation / keygen
Severity: High
Description:
In OrbitDB we have a test that verifies that database state is consistent across tabs in the same browser. Upon upgrading to js-ipfs 0.49, everything seems to work, except that test throws this error:
Steps to reproduce the error:
I made a PR that "fixes" it by reducing the number of tabs in the test from 3 to 2. More of a workaround since I couldn't get to the bottom of this in the afternoon I spent on it. I'm gonna keep investigating but any advice you have would be great!