Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with extensions #86

Open
alphapapa opened this issue Aug 8, 2023 · 2 comments
Open

Issues with extensions #86

alphapapa opened this issue Aug 8, 2023 · 2 comments

Comments

@alphapapa
Copy link

alphapapa commented Aug 8, 2023

@RangerMauve @josephmturner

Doing some basic live testing in our meeting today, we determined that there are some issues regarding extension support. Mauve is saying now that there seems to be something fishy in the peer replication logic, and that it's necessary to reproduce the problem in unit tests to fully understand it.

So here is a list of the approximate basic steps we've been using to test this functionality:

  1. Adam and Joseph run (using blog.mauve.moe for convenience in place of a 32- or 64-character key-like string):
curl --header "Accept: text/event-stream" --dump-header - 'http://localhost:4973/hyper/blog.mauve.moe/$/extensions/'

This sends a GET request to open a long-polling connection to hopefully receive peer-open and peer-remove events when we begin listening to the same key/extension pair. (Note: We have received some peer-remove events, but have yet to see any peer-open events.)

  1. Joseph and Adam run:
curl --dump-header - 'http://localhost:4973/hyper/blog.mauve.moe/$/extensions/.org.ushin.hyperdrive'

This sends a GET request to begin listening on the .org.ushin.hyperdrive extension.

  1. Joseph and Adam run:
curl --header "Accept: text/event-stream" --dump-header - 'http://localhost:4973/hyper/blog.mauve.moe/$/extensions/'

This sends a GET request that should return a JSON object with an array of the list of extensions being listened to. When we tested this a few weeks ago, it seemed to work; when we started listening to a new extension, it would appear in the list. But now this list is always empty; I'm not sure why. It returns:

HTTP/1.1 200 OK
content-type: application/json
Date: Tue, 08 Aug 2023 20:58:14 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked

[]
  1. Joseph and Adam run:
curl --dump-header - -d "foo=bar" 'http://localhost:4973/hyper/blog.mauve.moe/$/extensions/.org.ushin.hyperdrive'

That sends a POST request with an application/x-www-form-urlencoded data, which, if we understand correctly, the other peer should see an event for in the long-polling event-stream connection. But we have yet to receive any such event in the several times we've tried this.

AFAIK that's as far as we've gotten. Thanks for your help.

@josephmturner
Copy link
Contributor

Output of curl 'http://localhost:4973/':

{
        "name": "hyper-gateway",
        "version": "3.4.2",
        "repository": {
                "type": "git",
                "url": "git+https://github.com/RangerMauve/hyper-gateway.git"
        },
        "dependencies": {
                "hypercore-fetch": "^9.7.0",
                "hyper-sdk": "^4.3.0"
        }
}

@josephmturner
Copy link
Contributor

When both Adam and Joseph use one of Joseph's existing hyperdrive public keys (on which both of our machines are already replicating), we are able to send extension message back and forth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants