dashjoin / platform

Dashjoin Is an Open Source & Cloud Native Low Code Development and Integration Platform that helps teams deliver applications faster 🚀 Uses a data-driven approach inspired by Linked Data to make use of your existing assets
https://dashjoin.com
GNU Affero General Public License v3.0
89 stars 7 forks source link

Variables are lost, but session remains when closing the browser #369

Open pgrill79 opened 2 weeks ago

pgrill79 commented 2 weeks ago

We set several variables on the login - when the user now closes the browser and opens the site again, he is still logged in but all the variables are "forgotten" which leads to a strange behaviour.

aeberhart commented 2 weeks ago

In the browser, there are two kinds of storage (see https://stackoverflow.com/questions/5523140/are-there-any-benefits-to-session-storage-over-local-storage):

localStorage and sessionStorage both extend Storage. There is no difference between them except for the intended "non-persistence" of sessionStorage.

That is, the data stored in localStorage persists until explicitly deleted. Changes made are saved and available for all current and future visits to the site.

For sessionStorage, changes are only available per tab. Changes made are saved and available for the current page in that tab until it is closed. Once it is closed, the stored data is deleted.

We store browser authentication in localStore and delete it when you log out.

Variables and Notebooks are stored in the session store.

The rationale for this is that you may want to have two browser windows open that use different variables. E.g. if you're using a variable to store a query filter, you can view two versions of a chart in two windows.

So I guess the problem is, that once you re-open the browser, you're getting the on-login event to re-set the variables, right? I think we have the following options:

1) store variables in localStore - maybe more intuitive but we loose the multi-tab feature 2) introduce session and local variables - flexible but might be hard to understand 3) we're working on an on-load hook which could be used here