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

openAppSession does not indicate "attach" vs "create" #84

Open
OliverHenrichs opened this issue Sep 12, 2024 · 2 comments
Open

openAppSession does not indicate "attach" vs "create" #84

OliverHenrichs opened this issue Sep 12, 2024 · 2 comments

Comments

@OliverHenrichs
Copy link

OliverHenrichs commented Sep 12, 2024

Hi folks,

I use openAppSession to initiate new sessions and attach to existing ones on Qlik virtual proxies.

When I call e.g. session.getDoc(), the attached onWebSocketEvent function always logs the "opened" eventType.
This happens regardless of the session actually attaching or creating, probably because the Websocket actually gets opened.

How can I discriminate what is happening? Can you e.g. expose the used session ID? If it is the one that I give in openAppSession, then I know it attached. If not, I know I have used up a new session.

This is kind of important, because there is a session limit of 5 in Qlik.

Cheers Oliver

@nilzona
Copy link
Contributor

nilzona commented Sep 19, 2024

Hey Oliver. When using sessions at Qlik a rule of thumb is:

Same User on the Same App with the Same Identity Parameter = Same Session (= same websocket). When using openAppSession from @qlik/api we will always try to reuse the session if there is one.

We could expose a session id, but I'd like to understand a little bit more about the circumstances that makes you feel that you need it?

@OliverHenrichs
Copy link
Author

Hi,

we develop a writeback extension. Our backend triggers an app-reload on users saving their changes.
So far we let the sa_engine user trigger that reload.

If a customer's setup is multi-node and includes load-balancing in their virtual proxies, sa_engine user will ignore that.
That's bad, so we now use the user's session, which enables us to find the correct target node for the reload. But if - for whatever reason - we're not attaching to but instead create a new session, we reduce the user's ability to open Qlik in another browser / on another device...

So as a first step we at least want to know what is happening in order to decide what to do.

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