-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix stringify()
in net and host to respect host
#48
Conversation
Previously we were disregarding the `host` setting for all configs except in cases where `scope === 'public' && `opts.external != null`. This resolves the error by first checking whether `opts.host` is defined before falling back to automatic detection methods.
The code is a bit confusing, like host is defined here but is only used in the server code it seems. Also stringify has a close but different interpretation of host. Would be nice with some tests of this stuff. There are so many configurations to take into account. |
A bit more context for other people reading this. Seems to be this commit where multiserver scopes is always picking the default for the scope. So this is only a problem if you have multiple interfaces. |
Yeah, I think I've cleaned it up about as well as I'm able to without making any breaking changes, but it's still a bit hairy. Hopefully the comments are useful for future code spelunkers and the bugfix is useful for folks with multiple network interfaces (apparently common on macOS (see ssbc/patchwork#1035)). |
Nice refactor @christianbundy. Still thinking about writing a test, maybe I can have a go at that. |
Pushed up two tests |
Hey there! I'm the guy who originally discovered the issue on my machines. I just rebuilt Patchwork using the latest multiserver from this branch ( Right now
So there's definitely progress for the related to ssbc/patchwork#1035 |
Hey, could you run $ npm ls multiserver
ssb-patchwork@3.12.0-beta.2 /home/christianbundy/src/ssbc/patchwork
├─┬ ssb-client@4.7.4
│ └── UNMET DEPENDENCY multiserver@3.3.2
├─┬ ssb-server@14.1.12 (github:ssbc/ssb-server#982a053a608a19de59638c0056832bce34b8436b)
│ ├── UNMET DEPENDENCY multiserver@3.3.2
│ ├─┬ secret-stack@6.1.2
│ │ └── UNMET DEPENDENCY multiserver@3.3.2
│ └─┬ ssb-ws@5.1.1
│ └── UNMET DEPENDENCY multiserver@3.3.2
└─┬ ssb-ws@6.0.0
└── UNMET DEPENDENCY multiserver@3.3.2
npm ERR! missing: multiserver@3.3.2, required by ssb-client@4.7.4
npm ERR! missing: multiserver@3.3.2, required by ssb-server@14.1.12
npm ERR! missing: multiserver@3.3.2, required by secret-stack@6.1.2
npm ERR! missing: multiserver@3.3.2, required by ssb-ws@5.1.1
npm ERR! missing: multiserver@3.3.2, required by ssb-ws@6.0.0 Unfortunately ssb-server has a shrinkwrap file, which means that a normal
I don't think there's an easy way to test this in Patchwork right now. |
Also: thanks a bunch for adding those tests! |
@christianbundy sure, here you are!
Note that I added |
@the-kenny looks as if the depedency in ssb-server is still pointing to 3.3.2 and not this branch, that is probably why its not working is my guess. |
@arj03 Oh, are you sure? I thought the git-ref to the latest commit in this branch and all the |
That's my understanding as well. The ssb-server shrinkwrap makes it so that you can't easily change versions. You can confirm with `find node_modules -name multiserver` I think, that should output all of the different instances of the multiserver dependency.
Maybe you can delete the `ssb-server/node_modules/multiserver` and replace it with the one from Git? No easy way to do this with npm though.
…On Wed, May 15, 2019, at 00:40, Moritz Ulrich wrote:
@arj03 <https://github.com/arj03> Oh, are you sure? I thought the git-ref to the latest commit in this branch and all the `deduped` markers tell me it's using the correct one.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#48?email_source=notifications&email_token=AAEDIZHS75OO3KRDOGHZUQLPVO46ZA5CNFSM4HMJA5B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVNZNAQ#issuecomment-492541570>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAEDIZCROTADJJKHKGHUPBDPVO46ZANCNFSM4HMJA5BQ>.
|
@christianbundy Wow, NPM really is a mess. The hack to replace |
😨 Shrinkwraps... 😱 |
@christianbundy everyone is at dtn, so don't expect much reply to this for a few days, but for me this looks ready to merge. |
Oh, I'd totally forgotten about that. I'll merge and release as a patch, then I'll push my other multiserver branch. 🙃 |
Previously we were disregarding the
host
setting for all configsexcept in cases where
scope === 'public' &&
opts.external != null. This resolves the error by first checking whether
opts.host` is definedbefore falling back to automatic detection methods.
Resolves #47
Before
After
cc: @dominictarr @arj03 @regular @cryptix @the-kenny