reveal

sheluchin 2022-02-28T15:23:38.097609Z

I find that sometimes if I tap a very large map, the Reveal window goes completely white and becomes unresponsive (i.e. doesn't show subsequent taps). I use the nrepl middleware as described https://vlaaad.github.io/reveal/#nrepl-based-editors. It seems the only way to fix it once it happens is to restart my JVM. Is this a known issue, and is there some better way to restart Reveal other than rebooting the JVM?

vlaaad 2022-02-28T18:43:09.548469Z

Reveal is optimized for streaming big data structures though, I tried to make that part as fast and nonblocking as possible

vlaaad 2022-02-28T18:43:24.362849Z

Can you share the data structure?

vlaaad 2022-02-28T18:44:26.539519Z

Also is it possible that the data structure has self references? E.g. an atom that holds the reference to itself...

sheluchin 2022-02-28T19:45:37.115909Z

The last time it happened to me I tapped an XTDB node. I don't know the internals well enough to say whether it has self references. I also don't think it happens every single time. Is there some Reveal debugging log I can access to get an idea of what's happening?

vlaaad 2022-02-28T19:48:04.487039Z

nope..

sheluchin 2022-02-28T19:49:21.077029Z

Is there a way to reboot without rebooting the JVM? It would help me try to find a reproducible demo.

vlaaad 2022-02-28T19:50:36.089569Z

I see that xtdb itself prints xtdb nodes without any internals:

(defmethod print-method XtdbNode [_node ^Writer w] (.write w "#<XtdbNode>"))

vlaaad 2022-02-28T19:52:20.382079Z

maybe you could try the same? e.g.

(r/defstream XtdbNode [node]
  (r/raw-string "XtdbNode" {:fill :object}))

sheluchin 2022-02-28T19:53:03.437719Z

Indeed, that is the usual representation when you print, but sometimes tapping it and looking at the keys is helpful for debugging. I also don't think this has been isolated to XTDB for me... it comes up during the course of debugging different once in a while.

vlaaad 2022-02-28T19:54:59.390969Z

You'll probably be able to use view:table action to peek at contents

vlaaad 2022-02-28T19:56:29.065619Z

or you could define streaming with some contents

vlaaad 2022-02-28T19:56:42.527599Z

I'd suggest starting with changing the printing to XtdbNodes

vlaaad 2022-02-28T19:56:58.960879Z

and maybe looking for exceptions on nrepl process output?

sheluchin 2022-02-28T19:57:59.479469Z

I didn't see any exceptions pop up last time it happened, but I'll keep an eye out for that.

sheluchin 2022-02-28T19:59:01.048259Z

Thanks @vlaaad. I'll look at making a list of items in my project that should get different printing to try to avoid this.

sheluchin 2022-03-02T14:48:26.580119Z

@vlaaad I got around to setting up some streaming functions in my project today as you suggested. It's a great solution to the issue I was having and I'm looking forward to exploring other ways to customize and extend Reveal for my workflow as I get more familiar with the tool. Thanks again for the help! Just one more quick question about that. I put the defstream definition in my user namespace so it gets loaded when I start the REPL. Is that a reasonable place to put the customizations? Apologies if I missed it in the docs.

vlaaad 2022-03-02T14:56:38.223429Z

Yes, very reasonable, I do the same

👍 1