RangerMauve / hypercore-fetch

Implementation of Fetch that uses the Hyper SDK for loading p2p content
MIT License
36 stars 12 forks source link

Dns resolution tests #97

Closed josephmturner closed 7 months ago

josephmturner commented 10 months ago

After resolving a drive by its DNS domain, subsequent attempts to load the drive fail. Currently, the test added in b2089db623ac8080a595dd74b3d9967187097b03 hangs.

Here is a diff between the two times that the console.log runs in b0b68141078ea4dc57aa998128d43c3b7a2f4e7f. I'm guessing that the cores Map should have only one entry:

--- #<buffer 1 - drive resolved by DNS>
+++ #<buffer 2 - drive resolved by raw link>
@@ -15,7 +15,7 @@
     opened: false,
     closed: false,
     storage: [Function (anonymous)],
-    cores: Map(1) {
+    cores: Map(2) {
       '086fa67901a674176201f1eda27cca225635297c85f9626b3d23a9fdf929a0e3' => Hypercore(
         key: 92f727ef4ac96819a19bbe9030e23cabb384f828a1c3bdf91725af5bd9503433
         discoveryKey: 086fa67901a674176201f1eda27cca225635297c85f9626b3d23a9fdf929a0e3
@@ -26,7 +26,7 @@
         writable: false
         length: 724
         fork: 0
-        sessions: [ 3 ]
+        sessions: [ 4 ]
         activeRequests: [ 0 ]
         peers: [
           Peer(
@@ -36,6 +36,27 @@
             remoteCanUpgrade: true
           )
         ]
+      ),
+      '94cc58986bb7017cc09f6b49d91bfe46ac6ba4f991c6dc6cc55cecc3be771549' => Hypercore(
+        key: f74ff69c2490b931c95ed42fd4e31ab6c8d7bda6950721c9edb156fa2f973359
+        discoveryKey: 94cc58986bb7017cc09f6b49d91bfe46ac6ba4f991c6dc6cc55cecc3be771549
+        opened: true
+        closed: false
+        snapshotted: false
+        sparse: true
+        writable: false
+        length: 7073
+        fork: 0
+        sessions: [ 3 ]
+        activeRequests: [ 0 ]
+        peers: [
+          Peer(
+            remotePublicKey: 374f25cfc73eb9eb7497a1762f0409847de385e591e99355838b6abdabcb1900
+            remoteLength: 7073
+            remoteFork: 0
+            remoteCanUpgrade: true
+          )
+        ]
       )
     },
     cache: false,
@@ -64,7 +85,7 @@
       _readonly: false,
       _sessions: [Set],
       _rootStoreSessions: [Set],
-      _locks: Map(0) {},
+      _locks: [Map],
       _findingPeersCount: 0,
       _findingPeers: [],
       _isCorestore: true,
@@ -90,7 +111,9 @@
       )
     },
     _rootStoreSessions: Set(0) {},
-    _locks: Map(0) {},
+    _locks: Map(1) {
+      '086fa67901a674176201f1eda27cca225635297c85f9626b3d23a9fdf929a0e3' => [ReadWriteLock]
+    },
     _findingPeersCount: 0,
     _findingPeers: [],
     _isCorestore: true,
RangerMauve commented 7 months ago

Looking at the gh action run, your latest commit doesn't seem to trigger a fail. Is this the expected outcome?