nrepl icon indicating copy to clipboard operation
nrepl copied to clipboard

Use provided host in server-started-message

Open cichli opened this issue 1 year ago • 6 comments

Fixes #302.

I had to lift the logic that defaults port and bind from inet-socket up into start-server – otherwise they were nil on the server record. That does mean that they're now non-nil when socket is provided, but it shouldn't cause an issue as we always check socket first when it's relevant.

The last commit changes as-nrepl-uri to prefer cond over multiple nested if-lets; I recommend reviewing the commits one-by-one because of this.

cichli avatar Jun 18 '24 18:06 cichli

Looking at the CI failures it seems to me that IPv6 is probably not available on the test instances. Perhaps we can make such tests conditional?

ERROR in nrepl.cmdline-test/server-started-message (Net.java:-2)
edn transport
Uncaught exception, not in assertion.
Exception: java.net.SocketException: Protocol family unavailable

bbatsov avatar Jun 19 '24 05:06 bbatsov

Also - should we document somewhere this behavior?

bbatsov avatar Jun 19 '24 05:06 bbatsov

I took a closer look at the code and all of the changes look good to me. Feel free to merge, after you get the CI to pass.

bbatsov avatar Jun 19 '24 07:06 bbatsov

I'll review it once the tests pass. When I was doing the configuration work, I had some issue with defaulting port to 0 early, but I don't quite remember what that was. Probably something in the tests.

alexander-yakushev avatar Jul 04 '24 15:07 alexander-yakushev

@cichli I plan to cut a new nREPL release early next week, so if you want this to be a part of it, you should try to wrap up the PR over the weekend.

bbatsov avatar Aug 09 '24 10:08 bbatsov

@cichli Can you update this PR?

bbatsov avatar Dec 31 '24 07:12 bbatsov