Giter VIP home page Giter VIP logo

Comments (10)

plexus avatar plexus commented on May 30, 2024 1

Yup, something I've wanted for a long time. I decided to do it as a proxy to prevent middleware ordering issues. This way you're sure you get the messages as they go over the wire. It's also nice that you can just pipe this to a file and share it with developers.

I have some ideas of where to take this, for now it's pretty basic. I mainly wanted to sort out the network part, the rest should be straightforward.

from nrepl.

pfeodrippe avatar pfeodrippe commented on May 30, 2024

Definitively I'm going to tackle something about this at #84, thanks for this issue, it's gonna be a good guide! o/

from nrepl.

pfeodrippe avatar pfeodrippe commented on May 30, 2024

I'm having some problems with it

  1. When reading data, transport-read function is not available at FnTransport, can't see the data without changing the concrete transport implementation
  2. send-fn at FnTransport is opaque

For 1, we could get the message after decoded and encode it again, but maybe it would not be representative enough of the received message.

For 2, I can compose the send-fn field (if FnTransport becomes a Record) with another function or using the reversed proposed solution for 1

Maybe would be better to snitch the data for in and out streams, but using this would require a global configuration instead per message.

Any other options to be suggested?

from nrepl.

bbatsov avatar bbatsov commented on May 30, 2024

When reading data, transport-read function is not available at FnTransport, can't see the data without changing the concrete transport implementation

So using something like logging-transport wrapper won't work? I think this was my original idea, but I didn't think much about this.

Maybe would be better to snitch the data for in and out streams, but using this would require a global configuration instead per message.

Yeah, perhaps that'd be better. We can just add some debug/verbose config to start-server and potentially support this via nrepl.config. That won't allow us to toggle dynamically the logging on/off, but it'd be a perfectly adequate solution for me.

from nrepl.

cgrand avatar cgrand commented on May 30, 2024

There's something about the scope of this issue which is not clear to me: what kind of issues are we trying to debug? Transport/serialization issues or applicative issues (non-conforming messages etc.)?
I believe we shouldn't try to address both of them at once.

from nrepl.

bbatsov avatar bbatsov commented on May 30, 2024

Transport/serialization issues or applicative issues (non-conforming messages etc.)?

Both. :-)

I believe we shouldn't try to address both of them at once.

Yeah, I agree with you, therefore my suggestion to split this PR in two and focus on the more common problem - the non-conforming messages.

Transport/serialization issues weren't very common in the past (mostly because everyone was using the same transport, which was pretty well-tested), but I assume that when we start rolling out new transports there might be some rough edges there, that's why some mechanism to monitor the serialization would be useful.

from nrepl.

devurandom avatar devurandom commented on May 30, 2024

I am trying to debug an issue where internal messages sent from Cursive (i.e. not sent by the user) are printed in the Cursive REPL, instead of hidden. Colin Fleming suspects the response message ID might not match the original request anymore, but to confirm that, we would need logs of the nREPL messages that are actually sent over the wire. Is there already a solution for this in nREPL?

from nrepl.

bbatsov avatar bbatsov commented on May 30, 2024

@devurandom Nope, we never managed to sort out message logging on the server-side. There was some work done in #87, but it was not completed.

from nrepl.

devurandom avatar devurandom commented on May 30, 2024

@plexus just created https://github.com/lambdaisland/nrepl-proxy as a debugging tool for nREPL connections! ❤️ 🎉

from nrepl.

bbatsov avatar bbatsov commented on May 30, 2024

Cool idea!

from nrepl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.