Skip to content

✨Allow multiple user sessions (user+tab) to open the same project #8123

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

Merged

Conversation

sanderegg
Copy link
Member

@sanderegg sanderegg commented Jul 17, 2025

What do these changes do?

This is a rather noisy PR as there is some renaming going on. Here are the highlights of the changes:

  • renamed the locked field inside the Project model to shareState (or share_state internally)
    • changes are: instead of returning the user full name that owns the lock, now it returns a list of group IDs of the users that are owning the status (CLOSED, CLOSING, CLONING, EXPORTING, OPENING, OPENED and MAINTAINING)
    • this shareState is also emitted in the projectStateUpdated event (following Node.js variable nomenclature)
    • frontend was adjusted to the new attributes (@odeimaiz partially only as now it shows the group ID, I guess you will want to adjust this)
  • ProjectLocked is currently still used internally
  • connection of WEBSERVER_REALTIME_COLLABORATION ENV variable to the POST "/{VTAG}/projects/{{project_id}}:open" entrypoint (along with RTC_MAX_NUMBER_OF_USERS ENV)
  • new exception ProjectTooManyUserSessionsError is now raised when there are too many user sessions, thrown as a 409 http code
  • upgraded the openapi minor version
    • NOTE: WEBSERVER_DEV_FEATURES_ENABLED must be set to use that feature otherwise the current sharing behavior is kept (with the exception of the group IDs explained above)
    • NOTE2: RTC_MAX_NUMBER_OF_USERS is not stricly the number of users but the number of user-session or active tabs (as a reminder, each combination of a user/tab is equivalent to a user-session at the moment.

Bonuses and also noise:

  • should fix flakyness reported by @GitHK in services/director-v2/tests/unit/with_dbs/comp_scheduler/test_manager.py
  • some refactoring of fixtures

Next steps

  • add node locking to protect services from being opened by multiple users unless they can handle it

Related issue/s

How to test

Dev-ops

@sanderegg sanderegg added this to the Engage milestone Jul 17, 2025
@sanderegg sanderegg self-assigned this Jul 17, 2025
@sanderegg sanderegg added the a:webserver webserver's codebase. Assigning the area is particularly useful for bugs label Jul 17, 2025
Copy link

codecov bot commented Jul 17, 2025

Codecov Report

Attention: Patch coverage is 93.04348% with 8 lines in your changes missing coverage. Please review.

Project coverage is 88.08%. Comparing base (a71239a) to head (075efb8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8123      +/-   ##
==========================================
+ Coverage   88.07%   88.08%   +0.01%     
==========================================
  Files        1891     1889       -2     
  Lines       72775    72800      +25     
  Branches     1274     1280       +6     
==========================================
+ Hits        64094    64127      +33     
+ Misses       8303     8293      -10     
- Partials      378      380       +2     
Flag Coverage Δ
integrationtests 64.15% <50.00%> (+0.02%) ⬆️
unittests 86.71% <92.17%> (+0.01%) ⬆️
Components Coverage Δ
pkg_aws_library 93.93% <ø> (ø)
pkg_celery_library 87.34% <ø> (ø)
pkg_dask_task_models_library 79.62% <ø> (ø)
pkg_models_library 93.11% <87.23%> (-0.06%) ⬇️
pkg_notifications_library 85.26% <ø> (ø)
pkg_postgres_database 88.02% <ø> (ø)
pkg_service_integration 70.19% <ø> (ø)
pkg_service_library 71.48% <100.00%> (ø)
pkg_settings_library 90.45% <ø> (ø)
pkg_simcore_sdk 85.05% <ø> (ø)
agent 93.81% <ø> (ø)
api_server 93.02% <ø> (ø)
autoscaling 95.88% <ø> (ø)
catalog 92.34% <ø> (ø)
clusters_keeper 99.13% <ø> (ø)
dask_sidecar 92.37% <ø> (ø)
datcore_adapter 97.94% <ø> (ø)
director 76.14% <ø> (ø)
director_v2 91.02% <ø> (+0.01%) ⬆️
dynamic_scheduler 96.27% <ø> (ø)
dynamic_sidecar 90.09% <ø> (+0.01%) ⬆️
efs_guardian 89.76% <ø> (ø)
invitations 91.44% <ø> (ø)
payments 92.60% <ø> (ø)
resource_usage_tracker 92.50% <ø> (ø)
storage 86.44% <ø> (+0.04%) ⬆️
webclient ∅ <ø> (∅)
webserver 88.18% <96.96%> (+0.04%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a71239a...075efb8. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sanderegg sanderegg force-pushed the i1962/let-multiple-users-open-projects branch 9 times, most recently from 7c1e2d4 to 134714b Compare July 22, 2025 14:40
@sanderegg sanderegg marked this pull request as ready for review July 22, 2025 16:36
Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx
Careful with the reponse models. I think you got at least one wrong

Copy link
Collaborator

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! thanks 💯

Copy link
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rock and roll!

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@sanderegg sanderegg force-pushed the i1962/let-multiple-users-open-projects branch from 1ae57ce to f1f8749 Compare July 23, 2025 08:32
@sanderegg sanderegg added the 🤖-automerge marks PR as ready to be merged for Mergify label Jul 23, 2025
@sanderegg
Copy link
Member Author

@mergify queue

Copy link
Contributor

mergify bot commented Jul 23, 2025

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 633f3c1

Copy link

@sanderegg
Copy link
Member Author

@mergify requeue

Copy link
Contributor

mergify bot commented Jul 23, 2025

requeue

☑️ This pull request is already queued

@mergify mergify bot merged commit 633f3c1 into ITISFoundation:master Jul 23, 2025
148 of 151 checks passed
@sanderegg sanderegg deleted the i1962/let-multiple-users-open-projects branch July 23, 2025 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖-automerge marks PR as ready to be merged for Mergify a:webserver webserver's codebase. Assigning the area is particularly useful for bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants