RangerMauve / hyper-sdk

Make your own hyper apps!
https://www.youtube.com/watch?v=HyHk4aImd_I&list=PL7sG5SCUNyeYx8wnfMOUpsh7rM_g0w_cu&index=20
MIT License
292 stars 45 forks source link

Hyperdrive mounts between browser tabs not working #90

Closed jb33k closed 1 year ago

jb33k commented 2 years ago

I'm testing and trying to mount a hyperdrive created in another tab but the mount shows up empty.

In both tabs I create a new hyperdrive, wait both to be ready, write some files to drive2, get drive2.key.toString('hex') from tab 2 and try to mount in tab 1 with drive1.mount('ext', Buffer.from(drive2_key, 'hex')). But I get nothing in the mount. I can see from dev tools that I have an open wss connection to hyperswarm.mauve.moe and messages are being passed.

If I try this within one tab, everything works perfectly, so the problem seems to be related to hyperswarm?

If I understood README correctly, hyper-sdk is supposed to do everything for me behind the scenes, so I don't need to replicate the drives myself?

How can I debug this further?

RangerMauve commented 2 years ago

Is one of these tabs using private browsing? Sometimes that can affect things.

Also are both of these tabs on the same domain and using the same storage?

Generally speaking only one instance of the SDK should be running per domain at a time since it can lead to errors if two tabs try to modify the same storage.

Setting some breakpoints in the peer-add events might be useful to see if you're getting WebRTC connections in.

RangerMauve commented 1 year ago

Hyperdrive mounts don't exist in the latest version