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

nrepl server returns lacked response for multiple form evaluation #294

Closed
liquidz opened this issue Dec 29, 2022 · 9 comments
Closed

nrepl server returns lacked response for multiple form evaluation #294

liquidz opened this issue Dec 29, 2022 · 9 comments

Comments

@liquidz
Copy link

liquidz commented Dec 29, 2022

version

1.1.156

platform

macOS 13.1
node v16.15.0

problem

nrepl server returns lacked response for multiple form evaluation

repro

  • start nrepl server
  • connect to nrepl server
    • nc localhost [PORT NUMBER]
  • send eval message
    • d2:op4:eval4:code3:1 2e
  • nbb nrepl-server returns the following two responses (spaces are added for visibility)
    d 2:id le 2:ns 4:user 5:value 1:2 e
    d 2:id le 6:status l 4:done e e
    
    • The value 1 is lacked.

expected behavior

nrepl/nrepl returns the following three responses (spaces are added for visibility)

d 2:ns 4:user 7:session 36:8a6073e3-4183-47e5-bf4e-d5b96adadbae 5:value 1:1 e
d 2:ns 4:user 7:session 36:8a6073e3-4183-47e5-bf4e-d5b96adadbae 5:value 1:2 e
d 7:session 36:8a6073e3-4183-47e5-bf4e-d5b96adadbae 6:status l 4:done e e

Steps to confirm expected responses:

  • start nrepl server
    • clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"}}}' -M -m nrepl.cmdline
  • connect to nrepl server
    • nc localhost [PORT NUMBER]
  • send eval message
    • d2:op4:eval4:code3:1 2e
@borkdude
Copy link
Collaborator

Can you also include the forms that are evaluated normally in the REPL? This is easier for me to reproduce than to look at the bencode directly :)

@liquidz
Copy link
Author

liquidz commented Dec 29, 2022

Sure!

d2:op4:eval4:code3:1 2e

Forms are 1 2.
But these forms may be treated separately in the REPL, so I could not reproduce this problem in the REPL...

  • nbb
    Welcome to nbb v1.1.156!
    user=> 1 2
    1
    user=> 2
    user=>
    
  • Clojure
    Clojure 1.11.1
    user=> 1 2
    1
    2
    user=>
    

@borkdude
Copy link
Collaborator

So are you not typing the code in the REPL but talking to an nbb nREPL server programmatically?

@liquidz
Copy link
Author

liquidz commented Dec 29, 2022

Right.
I have tested my nREPL client with nbb's nREPL server and noticed a difference with clojure's nREPL server.
https://github.com/liquidz/deno-nrepl-client/blob/fbdeb7411734b53d5f4bfffdb814a43fd097dd8f/integration_test.ts#L85-L89

@borkdude
Copy link
Collaborator

Thanks, makes sense. The babashka nREPL server does work correctly, right?

@liquidz
Copy link
Author

liquidz commented Dec 29, 2022

bb nrepl-server returns correct three responses as same as clojure!

d 2:id 7:unknown 2:ns 4:user 7:session 4:none 5:value 1:1 e
d 2:id 7:unknown 2:ns 4:user 7:session 4:none 5:value 1:2 e
d 2:id 7:unknown 7:session 4:none 6:status l 4:done e e

@borkdude
Copy link
Collaborator

borkdude commented Jan 6, 2023

I've been looking into a solution but it will take a little longer before I have a good solution

@borkdude
Copy link
Collaborator

borkdude commented Jan 8, 2023

Work in progress in this branch: https://github.com/babashka/nbb/compare/nrepl-multiple-exprs
nREPL works, but have to clean up

@borkdude
Copy link
Collaborator

borkdude commented Jan 8, 2023

Publishing as 1.1.158

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