Gonna try something new. Live tooting my debugging session. Today's bug: If I open a `hyper://` URL that I should have the private key for without actually giving the `name` first, it won't generate the key and marks the drive as read only. Or something like that?

2/? Step one: Reproduce the issue. I'll see if I can make a test to reproduce what I'm seeing in @agregore , but with the lowest level primitive I use for hypercore dev, hyper-sdk

github.com/RangerMauve/hyper-s

3/?

Since the SDK is meant to work in both node.js and bare-kit, I'm using the `brittle` module for tests.

npmjs.com/package/brittle

4/?

First test will just reuse the SDK instance in memory but try to clear the core data and reload it from storage by URL. Test passed so it might be due to loading the SDK from scratch from memory (is there a private key cache in corestore?).

github.com/RangerMauve/hyper-s

5/? Reloading from disk also worked. Gonna get my reproducing steps clear within Agregore before I continue.

github.com/RangerMauve/hyper-s

6/? I open a page I published using the DWeb Scratchpad and then try to open the scratch pad and click "Look at your saved sites", it doesn't open and the request appears to be frozen. If I open the site via the "Look at your saved sites" page before trying to access its `hyper://` URL it works fine.

hyper://agregore.mauve.moe/apps/scratchpad.html

7/? The `showAllSaved` button uses the `hyper://` protocol handlers to resolve the local name `dweb_scratchpad` into a P2P archive URL using await fetch(`hyper://localhost/?key=${name}`, { method: 'POST' });

github.com/AgregoreWeb/website

8/? This will then invoke the `createKey` function inside hypercore-fetch via the protocol handlers. Setting a breakpoint inside the scratchpad, it seems this function never resolves.

github.com/RangerMauve/hyperco

Follow

9/? Trying to update the hyper-sdk tests to use drive instead of core isn't yielding the issue either. Maybe something in hypercore-fetch is adding more side effects than just initializing the drive? Gonna switch to hypercore-fetch and try to reproduce there.

github.com/RangerMauve/hyper-s

· · Web · 1 · 0 · 1

10/? Checking the code, there was nothing obvious. Adding a test, it seems to pass same as the SDK tests. It seems the bug might be somewhere in Electron or in Agregore's code. This means I need to start setting debug logs and breakpoints in the browser since my tests are non existent there.

github.com/RangerMauve/hyperco

Sign in to participate in the conversation
Mauvestodon

Escape ship from centralized social media run by Mauve.