-
Notifications
You must be signed in to change notification settings - Fork 324
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
rerendering results in websocket consumption #312
Comments
That's wierd... There shouldn't be a new neo4j session, Im pretty sure chrome network panel has which line of code generated the websocket, I checked the code and I did close the session on render complete, which makes it really weird as you didn't use any cypher config... |
Also checked I did close session when used, that's why the websocket still open? |
First connection:
Subsequent connections using viz.reload():
Subsequent connections reinitializing viz (see additional info in original post)
|
This is really wierd, it looks like driver bug as I do close this session onComplete, Ill test that out later this week |
Also for just changing color I would not suggest reloading the entire network, you can get the id from viz.nodes.get and change the data there |
When you select a node, a new cypher query is executed with the selected node being the "the root of the query" (see viz.renderWithCypher(cypherQuery())) |
In the second one, yes, in the original you only called reload 😅 anyway Ill test why the session doesn't close even though I call close probably tomorrow |
this one is almost a year old...but maybe this helps, as it seams to fit into the same area (possible the same root cause) With every reload() an extra "clickNode" event is created. What I mean: First time you create viz, everything is fine. I registerOnEvent for "clickNode", user clicks, and the function is called. That said: Something like this could cause internnaly to create multiple requests to the server, hence the websocket is spammed. Just as an idea. |
@mdopp that's a bug 😅 but it shouldn't affect the websocket as the event doesn't add any session to the neo4j |
I started a small project with neovis.js today. Everything works fine at first look but now I observe a problem:
Rendering my graph the first and second time works fine. After that every new rendering doubles the websocket connections in "pending" state. When the number reaches 32, exceptions are printed to the console.
Depending on my strategy to update the graph (when selecting a node) the websocket consumption differs.
I use the movie database example for my tests. The render method looks like this:
Screenshots of my tests:
Initial state after page load
Node selected and refresh done
Same node selected again and refresh done
Here comes the full source code:
additional info (latest results)
Changing the event handler (see below) improves the behavior. Before, the number of websocket connection doubles at each node click, after the number only increases by 1 at each node click...
The text was updated successfully, but these errors were encountered: