-
Notifications
You must be signed in to change notification settings - Fork 29
✨ allowing to log back into a study when the tab was closed #2383
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
✨ allowing to log back into a study when the tab was closed #2383
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2383 +/- ##
=======================================
Coverage 74.7% 74.7%
=======================================
Files 516 517 +1
Lines 20038 20161 +123
Branches 1972 2000 +28
=======================================
+ Hits 14984 15079 +95
- Misses 4530 4547 +17
- Partials 524 535 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
|
0c695eb
to
915f753
Compare
c65e149
to
e5a987d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition! A few comments and questions below.
services/web/client/source/class/osparc/dashboard/StudyBrowserButtonItem.js
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/exporter/formatters/models.py
Outdated
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/exporter/request_handlers.py
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/projects/projects_api.py
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/projects/projects_api.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💪 Thanks for bringing the Study statuses!
services/web/server/src/simcore_service_webserver/exporter/formatters/models.py
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/resource_manager/websocket_manager.py
Outdated
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/projects/project_lock.py
Outdated
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/projects/projects_api.py
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/projects/projects_api.py
Show resolved
Hide resolved
use a project locking mechanism to prevent opening when a project is closign
lock while exporting
…etween json schema and python models
e5a987d
to
dbfc512
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
look OK, please check below suggestion before merging
(SERVICE_KEY_RE, "node-meta-v0.0.1.json", ["key"]), | ||
], | ||
) | ||
def test_regex_pattern_same_in_jsonschema_and_python( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
await notify_project_state_update(app, project) | ||
|
||
|
||
# TODO: Once python 3.8 is in use this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# TODO: Once python 3.8 is in use this | |
import sys | |
if sys.version_info >= (3, 8): | |
raise Exception("use below implementation in py3.8+") |
this way you won't miss it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is a good point ...
I enabled it in py3.8 branch
What do these changes do?
The backend maintain a Redis-based registry where all user-allocated resources are kept (for now only socket IDs and project IDs).
These resources are linked to the user so-called "client session id" which is given by the frontend as the Broswer Tab ID when the websocket connection is created (Socket ID).
FRom the backend side it is not possible to distinguish between a network disconnection and a tab-closed. Therefore we do use a TTL (time-to-live) field in the Redis registry of 900 seconds. During that time, the same browser tab would be able to re-open the same study in case that it reconnects.
In the case of a closed tab, re-opening a new tab creates a new Tab ID. Therefore the backend treats that as "the user opened another tab and is trying to open a study that is already opened in another tab". Therefore it appears locked, and the user must wait 15 minutes until it gets closed, and after that the user may open it again.
Changes
Bonus:
make show_endpoints
shows the endpoint to some of the services on demandRelated issue/s
fixes #431
fixes #1952
How to test
Checklist