deephaven / web-client-ui

Deephaven Web Client UI
Apache License 2.0
29 stars 31 forks source link

`logout` Does Not Close Server Side Session #2256

Open nbauernfeind opened 1 month ago

nbauernfeind commented 1 month ago

As a user, I would like to be able to indicate to the web-ui that I am completely done with my session and that I would like resources cleaned up ASAP.

When I click the configuration wheel, and select logout, I would expect the client to tell the server that it has finished with the session. Forcefully releasing all outstanding objects.

I was able to verify that proactive release is not happening by setting a server-side breakpoint to catch when the session expires, but rather when the session timeout is triggered.

mattrunyon commented 1 month ago

Do we have "real" sessions in DHC now? I was under the impression there is 1 session that all connections share (when I open the UI in a separate or incognito tab, I can still access the widgets created in another tab)

Or are you talking about JS API exports to the client?

nbauernfeind commented 1 month ago

This "real" session you are referring to is that all clients must share the REPL session (aka Script Session).

Two different tabs cannot communicate with each other. Therefore, they have their own server side session; the session that owns the exports (a gRPC client session). We should at least release exports, but if you release the server side session instead then it will clean up all outstanding exports at once with minimal request by the client. I do not know if the jsapi exposes a method to close/release the client session or not - but if we don't have one, we should have one - and the web-ui should invoke it in this case. (at least, in my opinion this should be a side effect of such a "logout")

mattrunyon commented 1 month ago

Looks like we don't call anything on the web side except for clearing saved tokens. There is a session.close() in the JS API on IdeSession. Should we calling that and then the JS API should handle closing anything else associated with the session if it doesn't already do that?

nbauernfeind commented 1 month ago

That sounds correct. If session.close() does not propagate to the server, I'll take it up with Colin; but I suspect that it will.

I can easily test from a web-client feature branch (or PR) if that is helpful for you.

mofojed commented 1 month ago

Might be related to #1685